vdso64.lds.S 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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. PROVIDE(_vdso_data = . - __VVAR_PAGES * PAGE_SIZE);
  14. #ifdef CONFIG_TIME_NS
  15. PROVIDE(_timens_data = _vdso_data + PAGE_SIZE);
  16. #endif
  17. . = VDSO_LBASE + SIZEOF_HEADERS;
  18. .hash : { *(.hash) } :text
  19. .gnu.hash : { *(.gnu.hash) }
  20. .dynsym : { *(.dynsym) }
  21. .dynstr : { *(.dynstr) }
  22. .gnu.version : { *(.gnu.version) }
  23. .gnu.version_d : { *(.gnu.version_d) }
  24. .gnu.version_r : { *(.gnu.version_r) }
  25. .note : { *(.note.*) } :text :note
  26. . = ALIGN(16);
  27. .text : {
  28. *(.text .stub .text.* .gnu.linkonce.t.*)
  29. } :text
  30. PROVIDE(__etext = .);
  31. PROVIDE(_etext = .);
  32. PROVIDE(etext = .);
  33. /*
  34. * Other stuff is appended to the text segment:
  35. */
  36. .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
  37. .rodata1 : { *(.rodata1) }
  38. .dynamic : { *(.dynamic) } :text :dynamic
  39. .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr
  40. .eh_frame : { KEEP (*(.eh_frame)) } :text
  41. .gcc_except_table : { *(.gcc_except_table .gcc_except_table.*) }
  42. .rela.dyn ALIGN(8) : { *(.rela.dyn) }
  43. .got ALIGN(8) : { *(.got .toc) }
  44. .got.plt ALIGN(8) : { *(.got.plt) }
  45. _end = .;
  46. PROVIDE(end = .);
  47. /*
  48. * Stabs debugging sections are here too.
  49. */
  50. .stab 0 : { *(.stab) }
  51. .stabstr 0 : { *(.stabstr) }
  52. .stab.excl 0 : { *(.stab.excl) }
  53. .stab.exclstr 0 : { *(.stab.exclstr) }
  54. .stab.index 0 : { *(.stab.index) }
  55. .stab.indexstr 0 : { *(.stab.indexstr) }
  56. .comment 0 : { *(.comment) }
  57. /*
  58. * DWARF debug sections.
  59. * Symbols in the DWARF debugging sections are relative to the
  60. * beginning of the section so we begin them at 0.
  61. */
  62. /* DWARF 1 */
  63. .debug 0 : { *(.debug) }
  64. .line 0 : { *(.line) }
  65. /* GNU DWARF 1 extensions */
  66. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  67. .debug_sfnames 0 : { *(.debug_sfnames) }
  68. /* DWARF 1.1 and DWARF 2 */
  69. .debug_aranges 0 : { *(.debug_aranges) }
  70. .debug_pubnames 0 : { *(.debug_pubnames) }
  71. /* DWARF 2 */
  72. .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  73. .debug_abbrev 0 : { *(.debug_abbrev) }
  74. .debug_line 0 : { *(.debug_line) }
  75. .debug_frame 0 : { *(.debug_frame) }
  76. .debug_str 0 : { *(.debug_str) }
  77. .debug_loc 0 : { *(.debug_loc) }
  78. .debug_macinfo 0 : { *(.debug_macinfo) }
  79. /* SGI/MIPS DWARF 2 extensions */
  80. .debug_weaknames 0 : { *(.debug_weaknames) }
  81. .debug_funcnames 0 : { *(.debug_funcnames) }
  82. .debug_typenames 0 : { *(.debug_typenames) }
  83. .debug_varnames 0 : { *(.debug_varnames) }
  84. /* DWARF 3 */
  85. .debug_pubtypes 0 : { *(.debug_pubtypes) }
  86. .debug_ranges 0 : { *(.debug_ranges) }
  87. .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
  88. /DISCARD/ : {
  89. *(.note.GNU-stack)
  90. *(.branch_lt)
  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_gettimeofday;
  121. __kernel_clock_gettime;
  122. __kernel_clock_getres;
  123. __kernel_getcpu;
  124. __kernel_restart_syscall;
  125. __kernel_rt_sigreturn;
  126. __kernel_sigreturn;
  127. local: *;
  128. };
  129. }