vdso32.lds.S 3.4 KB

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