vdso32.lds.S 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * This is the infamous ld script for the 32 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("elf32-powerpcle", "elf32-powerpcle", "elf32-powerpcle")
  11. #else
  12. OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc")
  13. #endif
  14. OUTPUT_ARCH(powerpc:common)
  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. } :text
  31. PROVIDE(__etext = .);
  32. PROVIDE(_etext = .);
  33. PROVIDE(etext = .);
  34. . = ALIGN(8);
  35. VDSO_ftr_fixup_start = .;
  36. __ftr_fixup : { *(__ftr_fixup) }
  37. VDSO_ftr_fixup_end = .;
  38. . = ALIGN(8);
  39. VDSO_mmu_ftr_fixup_start = .;
  40. __mmu_ftr_fixup : { *(__mmu_ftr_fixup) }
  41. VDSO_mmu_ftr_fixup_end = .;
  42. . = ALIGN(8);
  43. VDSO_lwsync_fixup_start = .;
  44. __lwsync_fixup : { *(__lwsync_fixup) }
  45. VDSO_lwsync_fixup_end = .;
  46. #ifdef CONFIG_PPC64
  47. . = ALIGN(8);
  48. VDSO_fw_ftr_fixup_start = .;
  49. __fw_ftr_fixup : { *(__fw_ftr_fixup) }
  50. VDSO_fw_ftr_fixup_end = .;
  51. #endif
  52. /*
  53. * Other stuff is appended to the text segment:
  54. */
  55. .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
  56. .rodata1 : { *(.rodata1) }
  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. .fixup : { *(.fixup) }
  61. .dynamic : { *(.dynamic) } :text :dynamic
  62. .got : { *(.got) } :text
  63. .plt : { *(.plt) }
  64. _end = .;
  65. __end = .;
  66. PROVIDE(end = .);
  67. DWARF_DEBUG
  68. ELF_DETAILS
  69. /DISCARD/ : {
  70. *(.note.GNU-stack)
  71. *(.data .data.* .gnu.linkonce.d.* .sdata*)
  72. *(.bss .sbss .dynbss .dynsbss)
  73. *(.got1)
  74. }
  75. }
  76. /*
  77. * Very old versions of ld do not recognize this name token; use the constant.
  78. */
  79. #define PT_GNU_EH_FRAME 0x6474e550
  80. /*
  81. * We must supply the ELF program headers explicitly to get just one
  82. * PT_LOAD segment, and set the flags explicitly to make segments read-only.
  83. */
  84. PHDRS
  85. {
  86. text PT_LOAD FILEHDR PHDRS FLAGS(5); /* PF_R|PF_X */
  87. dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
  88. note PT_NOTE FLAGS(4); /* PF_R */
  89. eh_frame_hdr PT_GNU_EH_FRAME;
  90. }
  91. /*
  92. * This controls what symbols we export from the DSO.
  93. */
  94. VERSION
  95. {
  96. VDSO_VERSION_STRING {
  97. global:
  98. __kernel_get_syscall_map;
  99. __kernel_gettimeofday;
  100. __kernel_clock_gettime;
  101. __kernel_clock_gettime64;
  102. __kernel_clock_getres;
  103. __kernel_time;
  104. __kernel_get_tbfreq;
  105. __kernel_sync_dicache;
  106. __kernel_sigtramp32;
  107. __kernel_sigtramp_rt32;
  108. #if defined(CONFIG_PPC64) || !defined(CONFIG_SMP)
  109. __kernel_getcpu;
  110. #endif
  111. local: *;
  112. };
  113. }
  114. /*
  115. * Make the sigreturn code visible to the kernel.
  116. */
  117. VDSO_sigtramp32 = __kernel_sigtramp32;
  118. VDSO_sigtramp_rt32 = __kernel_sigtramp_rt32;