vdso32.lds.S 3.8 KB

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