vdso64.lds.S 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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.h>
  7. #include <asm/page.h>
  8. #include <asm-generic/vmlinux.lds.h>
  9. #ifdef __LITTLE_ENDIAN__
  10. OUTPUT_FORMAT("elf64-powerpcle", "elf64-powerpcle", "elf64-powerpcle")
  11. #else
  12. OUTPUT_FORMAT("elf64-powerpc", "elf64-powerpc", "elf64-powerpc")
  13. #endif
  14. OUTPUT_ARCH(powerpc:common64)
  15. SECTIONS
  16. {
  17. PROVIDE(_vdso_datapage = . - 2 * PAGE_SIZE);
  18. . = 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.* __ftr_alt_*)
  30. *(.sfpr .glink)
  31. } :text
  32. PROVIDE(__etext = .);
  33. PROVIDE(_etext = .);
  34. PROVIDE(etext = .);
  35. . = ALIGN(8);
  36. VDSO_ftr_fixup_start = .;
  37. __ftr_fixup : { *(__ftr_fixup) }
  38. VDSO_ftr_fixup_end = .;
  39. . = ALIGN(8);
  40. VDSO_mmu_ftr_fixup_start = .;
  41. __mmu_ftr_fixup : { *(__mmu_ftr_fixup) }
  42. VDSO_mmu_ftr_fixup_end = .;
  43. . = ALIGN(8);
  44. VDSO_lwsync_fixup_start = .;
  45. __lwsync_fixup : { *(__lwsync_fixup) }
  46. VDSO_lwsync_fixup_end = .;
  47. . = ALIGN(8);
  48. VDSO_fw_ftr_fixup_start = .;
  49. __fw_ftr_fixup : { *(__fw_ftr_fixup) }
  50. VDSO_fw_ftr_fixup_end = .;
  51. /*
  52. * Other stuff is appended to the text segment:
  53. */
  54. .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
  55. .rodata1 : { *(.rodata1) }
  56. .dynamic : { *(.dynamic) } :text :dynamic
  57. .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr
  58. .eh_frame : { KEEP (*(.eh_frame)) } :text
  59. .gcc_except_table : { *(.gcc_except_table) }
  60. .rela.dyn ALIGN(8) : { *(.rela.dyn) }
  61. .got ALIGN(8) : { *(.got .toc) }
  62. _end = .;
  63. PROVIDE(end = .);
  64. DWARF_DEBUG
  65. ELF_DETAILS
  66. /DISCARD/ : {
  67. *(.note.GNU-stack)
  68. *(.branch_lt)
  69. *(.data .data.* .gnu.linkonce.d.* .sdata*)
  70. *(.bss .sbss .dynbss .dynsbss)
  71. *(.opd)
  72. }
  73. }
  74. /*
  75. * Very old versions of ld do not recognize this name token; use the constant.
  76. */
  77. #define PT_GNU_EH_FRAME 0x6474e550
  78. /*
  79. * We must supply the ELF program headers explicitly to get just one
  80. * PT_LOAD segment, and set the flags explicitly to make segments read-only.
  81. */
  82. PHDRS
  83. {
  84. text PT_LOAD FILEHDR PHDRS FLAGS(5); /* PF_R|PF_X */
  85. dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
  86. note PT_NOTE FLAGS(4); /* PF_R */
  87. eh_frame_hdr PT_GNU_EH_FRAME;
  88. }
  89. /*
  90. * This controls what symbols we export from the DSO.
  91. */
  92. VERSION
  93. {
  94. VDSO_VERSION_STRING {
  95. global:
  96. __kernel_get_syscall_map;
  97. __kernel_gettimeofday;
  98. __kernel_clock_gettime;
  99. __kernel_clock_getres;
  100. __kernel_get_tbfreq;
  101. __kernel_sync_dicache;
  102. __kernel_sigtramp_rt64;
  103. __kernel_getcpu;
  104. __kernel_time;
  105. local: *;
  106. };
  107. }
  108. /*
  109. * Make the sigreturn code visible to the kernel.
  110. */
  111. VDSO_sigtramp_rt64 = __kernel_start_sigtramp_rt64;