vdso32.lds.S 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. .rela.dyn : { *(.rela .rela*) }
  65. _end = .;
  66. __end = .;
  67. PROVIDE(end = .);
  68. DWARF_DEBUG
  69. ELF_DETAILS
  70. /DISCARD/ : {
  71. *(.note.GNU-stack)
  72. *(*.EMB.apuinfo)
  73. *(.branch_lt)
  74. *(.data .data.* .gnu.linkonce.d.* .sdata*)
  75. *(.bss .sbss .dynbss .dynsbss)
  76. *(.got1 .glink .iplt)
  77. }
  78. }
  79. /*
  80. * Very old versions of ld do not recognize this name token; use the constant.
  81. */
  82. #define PT_GNU_EH_FRAME 0x6474e550
  83. /*
  84. * We must supply the ELF program headers explicitly to get just one
  85. * PT_LOAD segment, and set the flags explicitly to make segments read-only.
  86. */
  87. PHDRS
  88. {
  89. text PT_LOAD FILEHDR PHDRS FLAGS(5); /* PF_R|PF_X */
  90. dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
  91. note PT_NOTE FLAGS(4); /* PF_R */
  92. eh_frame_hdr PT_GNU_EH_FRAME;
  93. }
  94. /*
  95. * This controls what symbols we export from the DSO.
  96. */
  97. VERSION
  98. {
  99. VDSO_VERSION_STRING {
  100. global:
  101. __kernel_get_syscall_map;
  102. __kernel_gettimeofday;
  103. __kernel_clock_gettime;
  104. __kernel_clock_gettime64;
  105. __kernel_clock_getres;
  106. __kernel_time;
  107. __kernel_get_tbfreq;
  108. __kernel_sync_dicache;
  109. __kernel_sigtramp32;
  110. __kernel_sigtramp_rt32;
  111. #if defined(CONFIG_PPC64) || !defined(CONFIG_SMP)
  112. __kernel_getcpu;
  113. #endif
  114. __kernel_getrandom;
  115. local: *;
  116. };
  117. }
  118. /*
  119. * Make the sigreturn code visible to the kernel.
  120. */
  121. VDSO_sigtramp32 = __kernel_sigtramp32;
  122. VDSO_sigtramp_rt32 = __kernel_sigtramp_rt32;