vdso64.lds.S 3.4 KB

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