vdso32.lds.S 3.7 KB

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