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