vdso64.lds.S 3.8 KB

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