/arch/powerpc/kernel/vdso64/vdso64.lds.S

http://github.com/mirrors/linux · Assembly · 159 lines · 103 code · 22 blank · 34 comment · 0 complexity · 66829538985bb1ae6c92497482b74b34 MD5 · raw file

  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. #ifdef __LITTLE_ENDIAN__
  8. OUTPUT_FORMAT("elf64-powerpcle", "elf64-powerpcle", "elf64-powerpcle")
  9. #else
  10. OUTPUT_FORMAT("elf64-powerpc", "elf64-powerpc", "elf64-powerpc")
  11. #endif
  12. OUTPUT_ARCH(powerpc:common64)
  13. ENTRY(_start)
  14. SECTIONS
  15. {
  16. . = VDSO64_LBASE + SIZEOF_HEADERS;
  17. .hash : { *(.hash) } :text
  18. .gnu.hash : { *(.gnu.hash) }
  19. .dynsym : { *(.dynsym) }
  20. .dynstr : { *(.dynstr) }
  21. .gnu.version : { *(.gnu.version) }
  22. .gnu.version_d : { *(.gnu.version_d) }
  23. .gnu.version_r : { *(.gnu.version_r) }
  24. .note : { *(.note.*) } :text :note
  25. . = ALIGN(16);
  26. .text : {
  27. *(.text .stub .text.* .gnu.linkonce.t.* __ftr_alt_*)
  28. *(.sfpr .glink)
  29. } :text
  30. PROVIDE(__etext = .);
  31. PROVIDE(_etext = .);
  32. PROVIDE(etext = .);
  33. . = ALIGN(8);
  34. __ftr_fixup : { *(__ftr_fixup) }
  35. . = ALIGN(8);
  36. __mmu_ftr_fixup : { *(__mmu_ftr_fixup) }
  37. . = ALIGN(8);
  38. __lwsync_fixup : { *(__lwsync_fixup) }
  39. . = ALIGN(8);
  40. __fw_ftr_fixup : { *(__fw_ftr_fixup) }
  41. /*
  42. * Other stuff is appended to the text segment:
  43. */
  44. .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
  45. .rodata1 : { *(.rodata1) }
  46. .dynamic : { *(.dynamic) } :text :dynamic
  47. .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr
  48. .eh_frame : { KEEP (*(.eh_frame)) } :text
  49. .gcc_except_table : { *(.gcc_except_table) }
  50. .rela.dyn ALIGN(8) : { *(.rela.dyn) }
  51. .opd ALIGN(8) : { KEEP (*(.opd)) }
  52. .got ALIGN(8) : { *(.got .toc) }
  53. _end = .;
  54. PROVIDE(end = .);
  55. /*
  56. * Stabs debugging sections are here too.
  57. */
  58. .stab 0 : { *(.stab) }
  59. .stabstr 0 : { *(.stabstr) }
  60. .stab.excl 0 : { *(.stab.excl) }
  61. .stab.exclstr 0 : { *(.stab.exclstr) }
  62. .stab.index 0 : { *(.stab.index) }
  63. .stab.indexstr 0 : { *(.stab.indexstr) }
  64. .comment 0 : { *(.comment) }
  65. /*
  66. * DWARF debug sections.
  67. * Symbols in the DWARF debugging sections are relative to the beginning
  68. * of the section so we begin them at 0.
  69. */
  70. /* DWARF 1 */
  71. .debug 0 : { *(.debug) }
  72. .line 0 : { *(.line) }
  73. /* GNU DWARF 1 extensions */
  74. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  75. .debug_sfnames 0 : { *(.debug_sfnames) }
  76. /* DWARF 1.1 and DWARF 2 */
  77. .debug_aranges 0 : { *(.debug_aranges) }
  78. .debug_pubnames 0 : { *(.debug_pubnames) }
  79. /* DWARF 2 */
  80. .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  81. .debug_abbrev 0 : { *(.debug_abbrev) }
  82. .debug_line 0 : { *(.debug_line) }
  83. .debug_frame 0 : { *(.debug_frame) }
  84. .debug_str 0 : { *(.debug_str) }
  85. .debug_loc 0 : { *(.debug_loc) }
  86. .debug_macinfo 0 : { *(.debug_macinfo) }
  87. /* SGI/MIPS DWARF 2 extensions */
  88. .debug_weaknames 0 : { *(.debug_weaknames) }
  89. .debug_funcnames 0 : { *(.debug_funcnames) }
  90. .debug_typenames 0 : { *(.debug_typenames) }
  91. .debug_varnames 0 : { *(.debug_varnames) }
  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_datapage_offset;
  125. __kernel_get_syscall_map;
  126. __kernel_gettimeofday;
  127. __kernel_clock_gettime;
  128. __kernel_clock_getres;
  129. __kernel_get_tbfreq;
  130. __kernel_sync_dicache;
  131. __kernel_sync_dicache_p5;
  132. __kernel_sigtramp_rt64;
  133. __kernel_getcpu;
  134. __kernel_time;
  135. local: *;
  136. };
  137. }