xref: /freebsd-14.2/sys/conf/ldscript.arm64 (revision bb5f7016)
1OUTPUT_ARCH(aarch64)
2ENTRY(_start)
3
4SEARCH_DIR(/usr/lib);
5SECTIONS
6{
7  /* Read-only sections, merged into text segment: */
8  . = text_start; /* This is set using --defsym= on the command line. */
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
63  . = ALIGN(4);
64  _extab_start = .;
65  PROVIDE(extab_start = .);
66  .ARM.extab : { *(.ARM.extab) }
67  _extab.end = .;
68  PROVIDE(extab_end = .);
69
70  _exidx_start = .;
71  PROVIDE(exidx_start = .);
72  .ARM.exidx : { *(.ARM.exidx) }
73  _exidx_end = .;
74  PROVIDE(exidx_end = .);
75
76  /* Adjust the address for the data segment.  We want to adjust up to
77     the same address within the page on the next page up.  */
78  . = ALIGN(0x1000) + (. & (0x1000 - 1)) ;
79  .data    :
80  {
81    *(.data)
82    *(.gnu.linkonce.d*)
83  }
84  . = ALIGN(128);
85  .data.read_frequently :
86  {
87    *(SORT_BY_ALIGNMENT(.data.read_frequently))
88  }
89  .data.read_mostly :
90  {
91    *(.data.read_mostly)
92  }
93  . = ALIGN(128);
94  .data.exclusive_cache_line :
95  {
96    *(.data.exclusive_cache_line)
97  }
98  . = ALIGN(128);
99  .data1   : { *(.data1) }
100  . = ALIGN(32 / 8);
101  .init_array    :
102  {
103    PROVIDE_HIDDEN (__init_array_start = .);
104    KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*)))
105    KEEP (*(.init_array))
106    PROVIDE_HIDDEN (__init_array_end = .);
107  }
108  .fini_array    :
109  {
110    PROVIDE_HIDDEN (__fini_array_start = .);
111    KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*)))
112    KEEP (*(.fini_array))
113    PROVIDE_HIDDEN (__fini_array_end = .);
114  }
115  _start_ctors = .;
116  PROVIDE (start_ctors = .);
117  .ctors         :
118  {
119    *(.ctors)
120  }
121  _stop_ctors = .;
122  PROVIDE (stop_ctors = .);
123  .dtors         :
124  {
125    *(.dtors)
126  }
127  .got           : { *(.got.plt) *(.got) }
128  .dynamic       : { *(.dynamic) }
129  /* We want the small data sections together, so single-instruction offsets
130     can access them all, and initialized data all before uninitialized, so
131     we can shorten the on-disk segment size.  */
132  . = ALIGN(8);
133  .sdata     : { *(.sdata) }
134  _edata  =  .;
135  PROVIDE (edata = .);
136  . = ALIGN(16);
137  __bss_start = .;
138  .sbss      : { *(.sbss) *(.scommon) }
139  .bss       :
140  {
141   *(.dynbss)
142   *(.bss)
143   *(COMMON)
144   . = ALIGN(16);
145   __bss_end = .;
146   /* A section for the initial page table, it doesn't need to be in the
147      kernel file, however unlike normal .bss entries should not be zeroed
148      out as we use it before the .bss section is cleared. */
149   *(.init_pagetable)
150  }
151  _end = . ;
152  PROVIDE (end = .);
153  /* Stabs debugging sections.  */
154  .stab 0 : { *(.stab) }
155  .stabstr 0 : { *(.stabstr) }
156  .stab.excl 0 : { *(.stab.excl) }
157  .stab.exclstr 0 : { *(.stab.exclstr) }
158  .stab.index 0 : { *(.stab.index) }
159  .stab.indexstr 0 : { *(.stab.indexstr) }
160  .comment 0 : { *(.comment) }
161  /* DWARF debug sections.
162     Symbols in the DWARF debugging sections are relative to the beginning
163     of the section so we begin them at 0.  */
164  /* DWARF 1 */
165  .debug          0 : { *(.debug) }
166  .line           0 : { *(.line) }
167  /* GNU DWARF 1 extensions */
168  .debug_srcinfo  0 : { *(.debug_srcinfo) }
169  .debug_sfnames  0 : { *(.debug_sfnames) }
170  /* DWARF 1.1 and DWARF 2 */
171  .debug_aranges  0 : { *(.debug_aranges) }
172  .debug_pubnames 0 : { *(.debug_pubnames) }
173  /* DWARF 2 */
174  .debug_info     0 : { *(.debug_info) }
175  .debug_abbrev   0 : { *(.debug_abbrev) }
176  .debug_line     0 : { *(.debug_line) }
177  .debug_frame    0 : { *(.debug_frame) }
178  .debug_str      0 : { *(.debug_str) }
179  .debug_loc      0 : { *(.debug_loc) }
180  .debug_macinfo  0 : { *(.debug_macinfo) }
181  /* SGI/MIPS DWARF 2 extensions */
182  .debug_weaknames 0 : { *(.debug_weaknames) }
183  .debug_funcnames 0 : { *(.debug_funcnames) }
184  .debug_typenames 0 : { *(.debug_typenames) }
185  .debug_varnames  0 : { *(.debug_varnames) }
186  /* These must appear regardless of  .  */
187}
188