ldscript.arm64 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. OUTPUT_ARCH(aarch64)
  2. ENTRY(_start)
  3. SEARCH_DIR(/usr/lib);
  4. SECTIONS
  5. {
  6. /* Read-only sections, merged into text segment: */
  7. . = text_start; /* This is set using --defsym= on the command line. */
  8. .vmm_vectors : { *(.vmm_vectors) }
  9. .text :
  10. {
  11. *(.text)
  12. *(.stub)
  13. /* .gnu.warning sections are handled specially by elf32.em. */
  14. *(.gnu.warning)
  15. *(.gnu.linkonce.t*)
  16. } =0x9090
  17. _etext = .;
  18. PROVIDE (etext = .);
  19. .fini : { *(.fini) } =0x9090
  20. .rodata : { *(.rodata*) *(.gnu.linkonce.r*) }
  21. .rodata1 : { *(.rodata1) }
  22. .interp : { *(.interp) }
  23. .hash : { *(.hash) }
  24. .dynsym : { *(.dynsym) }
  25. .dynstr : { *(.dynstr) }
  26. .gnu.version : { *(.gnu.version) }
  27. .gnu.version_d : { *(.gnu.version_d) }
  28. .gnu.version_r : { *(.gnu.version_r) }
  29. .note.gnu.build-id : {
  30. PROVIDE (__build_id_start = .);
  31. *(.note.gnu.build-id)
  32. PROVIDE (__build_id_end = .);
  33. }
  34. .rel.text :
  35. { *(.rel.text) *(.rel.gnu.linkonce.t*) }
  36. .rela.text :
  37. { *(.rela.text) *(.rela.gnu.linkonce.t*) }
  38. .rel.data :
  39. { *(.rel.data) *(.rel.gnu.linkonce.d*) }
  40. .rela.data :
  41. { *(.rela.data) *(.rela.gnu.linkonce.d*) }
  42. .rel.rodata :
  43. { *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
  44. .rela.rodata :
  45. { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
  46. .rel.got : { *(.rel.got) }
  47. .rela.got : { *(.rela.got) }
  48. .rel.ctors : { *(.rel.ctors) }
  49. .rela.ctors : { *(.rela.ctors) }
  50. .rel.dtors : { *(.rel.dtors) }
  51. .rela.dtors : { *(.rela.dtors) }
  52. .rel.init : { *(.rel.init) }
  53. .rela.init : { *(.rela.init) }
  54. .rel.fini : { *(.rel.fini) }
  55. .rela.fini : { *(.rela.fini) }
  56. .rel.bss : { *(.rel.bss) }
  57. .rela.bss : { *(.rela.bss) }
  58. .rel.plt : { *(.rel.plt) }
  59. .rela.plt : { *(.rela.plt) }
  60. .init : { *(.init) } =0x9090
  61. .plt : { *(.plt) }
  62. . = ALIGN(4);
  63. _extab_start = .;
  64. PROVIDE(extab_start = .);
  65. .ARM.extab : { *(.ARM.extab) }
  66. _extab.end = .;
  67. PROVIDE(extab_end = .);
  68. _exidx_start = .;
  69. PROVIDE(exidx_start = .);
  70. .ARM.exidx : { *(.ARM.exidx) }
  71. _exidx_end = .;
  72. PROVIDE(exidx_end = .);
  73. /* Adjust the address for the data segment. We want to adjust up to
  74. the same address within the page on the next page up. */
  75. . = ALIGN(0x1000) + (. & (0x1000 - 1)) ;
  76. .data :
  77. {
  78. *(.data)
  79. *(.gnu.linkonce.d*)
  80. }
  81. . = ALIGN(128);
  82. .data.read_frequently :
  83. {
  84. *(SORT_BY_ALIGNMENT(.data.read_frequently))
  85. }
  86. .data.read_mostly :
  87. {
  88. *(.data.read_mostly)
  89. }
  90. . = ALIGN(128);
  91. .data.exclusive_cache_line :
  92. {
  93. *(.data.exclusive_cache_line)
  94. }
  95. . = ALIGN(128);
  96. .data1 : { *(.data1) }
  97. . = ALIGN(32 / 8);
  98. _start_ctors = .;
  99. PROVIDE (start_ctors = .);
  100. .ctors :
  101. {
  102. *(.ctors)
  103. }
  104. _stop_ctors = .;
  105. PROVIDE (stop_ctors = .);
  106. .dtors :
  107. {
  108. *(.dtors)
  109. }
  110. .got : { *(.got.plt) *(.got) }
  111. .dynamic : { *(.dynamic) }
  112. /* We want the small data sections together, so single-instruction offsets
  113. can access them all, and initialized data all before uninitialized, so
  114. we can shorten the on-disk segment size. */
  115. . = ALIGN(8);
  116. .sdata : { *(.sdata) }
  117. _edata = .;
  118. PROVIDE (edata = .);
  119. __bss_start = .;
  120. .sbss : { *(.sbss) *(.scommon) }
  121. .bss :
  122. {
  123. *(.dynbss)
  124. *(.bss)
  125. *(COMMON)
  126. . = ALIGN(8);
  127. __bss_end = .;
  128. /* A section for the initial page table, it doesn't need to be in the
  129. kernel file, however unlike normal .bss entries should not be zeroed
  130. out as we use it before the .bss section is cleared. */
  131. *(.init_pagetable)
  132. }
  133. _end = . ;
  134. PROVIDE (end = .);
  135. /* Stabs debugging sections. */
  136. .stab 0 : { *(.stab) }
  137. .stabstr 0 : { *(.stabstr) }
  138. .stab.excl 0 : { *(.stab.excl) }
  139. .stab.exclstr 0 : { *(.stab.exclstr) }
  140. .stab.index 0 : { *(.stab.index) }
  141. .stab.indexstr 0 : { *(.stab.indexstr) }
  142. .comment 0 : { *(.comment) }
  143. /* DWARF debug sections.
  144. Symbols in the DWARF debugging sections are relative to the beginning
  145. of the section so we begin them at 0. */
  146. /* DWARF 1 */
  147. .debug 0 : { *(.debug) }
  148. .line 0 : { *(.line) }
  149. /* GNU DWARF 1 extensions */
  150. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  151. .debug_sfnames 0 : { *(.debug_sfnames) }
  152. /* DWARF 1.1 and DWARF 2 */
  153. .debug_aranges 0 : { *(.debug_aranges) }
  154. .debug_pubnames 0 : { *(.debug_pubnames) }
  155. /* DWARF 2 */
  156. .debug_info 0 : { *(.debug_info) }
  157. .debug_abbrev 0 : { *(.debug_abbrev) }
  158. .debug_line 0 : { *(.debug_line) }
  159. .debug_frame 0 : { *(.debug_frame) }
  160. .debug_str 0 : { *(.debug_str) }
  161. .debug_loc 0 : { *(.debug_loc) }
  162. .debug_macinfo 0 : { *(.debug_macinfo) }
  163. /* SGI/MIPS DWARF 2 extensions */
  164. .debug_weaknames 0 : { *(.debug_weaknames) }
  165. .debug_funcnames 0 : { *(.debug_funcnames) }
  166. .debug_typenames 0 : { *(.debug_typenames) }
  167. .debug_varnames 0 : { *(.debug_varnames) }
  168. .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
  169. /DISCARD/ : { *(.note.GNU-stack) }
  170. }