/arch/powerpc/kernel/vdso32/vdso32.lds.S

http://github.com/mirrors/linux · Assembly · 164 lines · 109 code · 21 blank · 34 comment · 1 complexity · 71971e54445550c248ce3fea404c5409 MD5 · raw file

  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * This is the infamous ld script for the 32 bits vdso
  4. * library
  5. */
  6. #include <asm/vdso.h>
  7. #ifdef __LITTLE_ENDIAN__
  8. OUTPUT_FORMAT("elf32-powerpcle", "elf32-powerpcle", "elf32-powerpcle")
  9. #else
  10. OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc")
  11. #endif
  12. OUTPUT_ARCH(powerpc:common)
  13. ENTRY(_start)
  14. SECTIONS
  15. {
  16. . = VDSO32_LBASE + SIZEOF_HEADERS;
  17. .hash : { *(.hash) } :text
  18. .gnu.hash : { *(.gnu.hash) }
  19. .dynsym : { *(.dynsym) }
  20. .dynstr : { *(.dynstr) }
  21. .gnu.version : { *(.gnu.version) }
  22. .gnu.version_d : { *(.gnu.version_d) }
  23. .gnu.version_r : { *(.gnu.version_r) }
  24. .note : { *(.note.*) } :text :note
  25. . = ALIGN(16);
  26. .text : {
  27. *(.text .stub .text.* .gnu.linkonce.t.* __ftr_alt_*)
  28. } :text
  29. PROVIDE(__etext = .);
  30. PROVIDE(_etext = .);
  31. PROVIDE(etext = .);
  32. . = ALIGN(8);
  33. __ftr_fixup : { *(__ftr_fixup) }
  34. . = ALIGN(8);
  35. __mmu_ftr_fixup : { *(__mmu_ftr_fixup) }
  36. . = ALIGN(8);
  37. __lwsync_fixup : { *(__lwsync_fixup) }
  38. #ifdef CONFIG_PPC64
  39. . = ALIGN(8);
  40. __fw_ftr_fixup : { *(__fw_ftr_fixup) }
  41. #endif
  42. /*
  43. * Other stuff is appended to the text segment:
  44. */
  45. .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
  46. .rodata1 : { *(.rodata1) }
  47. .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr
  48. .eh_frame : { KEEP (*(.eh_frame)) } :text
  49. .gcc_except_table : { *(.gcc_except_table) }
  50. .fixup : { *(.fixup) }
  51. .dynamic : { *(.dynamic) } :text :dynamic
  52. .got : { *(.got) } :text
  53. .plt : { *(.plt) }
  54. _end = .;
  55. __end = .;
  56. PROVIDE(end = .);
  57. /*
  58. * Stabs debugging sections are here too.
  59. */
  60. .stab 0 : { *(.stab) }
  61. .stabstr 0 : { *(.stabstr) }
  62. .stab.excl 0 : { *(.stab.excl) }
  63. .stab.exclstr 0 : { *(.stab.exclstr) }
  64. .stab.index 0 : { *(.stab.index) }
  65. .stab.indexstr 0 : { *(.stab.indexstr) }
  66. .comment 0 : { *(.comment) }
  67. /*
  68. * DWARF debug sections.
  69. * Symbols in the DWARF debugging sections are relative to the beginning
  70. * of the section so we begin them at 0.
  71. */
  72. /* DWARF 1 */
  73. .debug 0 : { *(.debug) }
  74. .line 0 : { *(.line) }
  75. /* GNU DWARF 1 extensions */
  76. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  77. .debug_sfnames 0 : { *(.debug_sfnames) }
  78. /* DWARF 1.1 and DWARF 2 */
  79. .debug_aranges 0 : { *(.debug_aranges) }
  80. .debug_pubnames 0 : { *(.debug_pubnames) }
  81. /* DWARF 2 */
  82. .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  83. .debug_abbrev 0 : { *(.debug_abbrev) }
  84. .debug_line 0 : { *(.debug_line) }
  85. .debug_frame 0 : { *(.debug_frame) }
  86. .debug_str 0 : { *(.debug_str) }
  87. .debug_loc 0 : { *(.debug_loc) }
  88. .debug_macinfo 0 : { *(.debug_macinfo) }
  89. /* SGI/MIPS DWARF 2 extensions */
  90. .debug_weaknames 0 : { *(.debug_weaknames) }
  91. .debug_funcnames 0 : { *(.debug_funcnames) }
  92. .debug_typenames 0 : { *(.debug_typenames) }
  93. .debug_varnames 0 : { *(.debug_varnames) }
  94. /DISCARD/ : {
  95. *(.note.GNU-stack)
  96. *(.data .data.* .gnu.linkonce.d.* .sdata*)
  97. *(.bss .sbss .dynbss .dynsbss)
  98. }
  99. }
  100. /*
  101. * Very old versions of ld do not recognize this name token; use the constant.
  102. */
  103. #define PT_GNU_EH_FRAME 0x6474e550
  104. /*
  105. * We must supply the ELF program headers explicitly to get just one
  106. * PT_LOAD segment, and set the flags explicitly to make segments read-only.
  107. */
  108. PHDRS
  109. {
  110. text PT_LOAD FILEHDR PHDRS FLAGS(5); /* PF_R|PF_X */
  111. dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
  112. note PT_NOTE FLAGS(4); /* PF_R */
  113. eh_frame_hdr PT_GNU_EH_FRAME;
  114. }
  115. /*
  116. * This controls what symbols we export from the DSO.
  117. */
  118. VERSION
  119. {
  120. VDSO_VERSION_STRING {
  121. global:
  122. /*
  123. * Has to be there for the kernel to find
  124. */
  125. __kernel_datapage_offset;
  126. __kernel_get_syscall_map;
  127. #ifndef CONFIG_PPC_BOOK3S_601
  128. __kernel_gettimeofday;
  129. __kernel_clock_gettime;
  130. __kernel_clock_getres;
  131. __kernel_time;
  132. __kernel_get_tbfreq;
  133. #endif
  134. __kernel_sync_dicache;
  135. __kernel_sync_dicache_p5;
  136. __kernel_sigtramp32;
  137. __kernel_sigtramp_rt32;
  138. #if defined(CONFIG_PPC64) || !defined(CONFIG_SMP)
  139. __kernel_getcpu;
  140. #endif
  141. local: *;
  142. };
  143. }