xref: /freebsd/sys/conf/ldscript.arm64 (revision 0b3105a37d7adcadcb720112fed4dc4e8040be99)
1/* $FreeBSD$ */
2OUTPUT_ARCH(aarch64)
3ENTRY(_start)
4
5SEARCH_DIR(/usr/lib);
6SECTIONS
7{
8  /* Read-only sections, merged into text segment: */
9  . = kernbase + SIZEOF_HEADERS;
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  .rel.text      :
31    { *(.rel.text) *(.rel.gnu.linkonce.t*) }
32  .rela.text     :
33    { *(.rela.text) *(.rela.gnu.linkonce.t*) }
34  .rel.data      :
35    { *(.rel.data) *(.rel.gnu.linkonce.d*) }
36  .rela.data     :
37    { *(.rela.data) *(.rela.gnu.linkonce.d*) }
38  .rel.rodata    :
39    { *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
40  .rela.rodata   :
41    { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
42  .rel.got       : { *(.rel.got)		}
43  .rela.got      : { *(.rela.got)		}
44  .rel.ctors     : { *(.rel.ctors)	}
45  .rela.ctors    : { *(.rela.ctors)	}
46  .rel.dtors     : { *(.rel.dtors)	}
47  .rela.dtors    : { *(.rela.dtors)	}
48  .rel.init      : { *(.rel.init)	}
49  .rela.init     : { *(.rela.init)	}
50  .rel.fini      : { *(.rel.fini)	}
51  .rela.fini     : { *(.rela.fini)	}
52  .rel.bss       : { *(.rel.bss)		}
53  .rela.bss      : { *(.rela.bss)		}
54  .rel.plt       : { *(.rel.plt)		}
55  .rela.plt      : { *(.rela.plt)		}
56  .init          : { *(.init)	} =0x9090
57  .plt      : { *(.plt)	}
58
59  . = ALIGN(4);
60  _extab_start = .;
61  PROVIDE(extab_start = .);
62  .ARM.extab : { *(.ARM.extab) }
63  _extab.end = .;
64  PROVIDE(extab_end = .);
65
66  _exidx_start = .;
67  PROVIDE(exidx_start = .);
68  .ARM.exidx : { *(.ARM.exidx) }
69  _exidx_end = .;
70  PROVIDE(exidx_end = .);
71
72  /* Adjust the address for the data segment.  We want to adjust up to
73     the same address within the page on the next page up.  */
74  . = ALIGN(0x1000) + (. & (0x1000 - 1)) ;
75  .data    :
76  {
77    *(.data)
78    *(.gnu.linkonce.d*)
79    CONSTRUCTORS
80  }
81  .data1   : { *(.data1) }
82  . = ALIGN(32 / 8);
83  _start_ctors = .;
84  PROVIDE (start_ctors = .);
85  .ctors         :
86  {
87    *(.ctors)
88  }
89  _stop_ctors = .;
90  PROVIDE (stop_ctors = .);
91  .dtors         :
92  {
93    *(.dtors)
94  }
95  .got           : { *(.got.plt) *(.got) }
96  .dynamic       : { *(.dynamic) }
97  /* We want the small data sections together, so single-instruction offsets
98     can access them all, and initialized data all before uninitialized, so
99     we can shorten the on-disk segment size.  */
100  . = ALIGN(8);
101  .sdata     : { *(.sdata) }
102  _edata  =  .;
103  PROVIDE (edata = .);
104  __bss_start = .;
105  .sbss      : { *(.sbss) *(.scommon) }
106  .bss       :
107  {
108   *(.dynbss)
109   *(.bss)
110   *(COMMON)
111  }
112  . = ALIGN(8);
113  _end = . ;
114  PROVIDE (end = .);
115  /* Stabs debugging sections.  */
116  .stab 0 : { *(.stab) }
117  .stabstr 0 : { *(.stabstr) }
118  .stab.excl 0 : { *(.stab.excl) }
119  .stab.exclstr 0 : { *(.stab.exclstr) }
120  .stab.index 0 : { *(.stab.index) }
121  .stab.indexstr 0 : { *(.stab.indexstr) }
122  .comment 0 : { *(.comment) }
123  /* DWARF debug sections.
124     Symbols in the DWARF debugging sections are relative to the beginning
125     of the section so we begin them at 0.  */
126  /* DWARF 1 */
127  .debug          0 : { *(.debug) }
128  .line           0 : { *(.line) }
129  /* GNU DWARF 1 extensions */
130  .debug_srcinfo  0 : { *(.debug_srcinfo) }
131  .debug_sfnames  0 : { *(.debug_sfnames) }
132  /* DWARF 1.1 and DWARF 2 */
133  .debug_aranges  0 : { *(.debug_aranges) }
134  .debug_pubnames 0 : { *(.debug_pubnames) }
135  /* DWARF 2 */
136  .debug_info     0 : { *(.debug_info) }
137  .debug_abbrev   0 : { *(.debug_abbrev) }
138  .debug_line     0 : { *(.debug_line) }
139  .debug_frame    0 : { *(.debug_frame) }
140  .debug_str      0 : { *(.debug_str) }
141  .debug_loc      0 : { *(.debug_loc) }
142  .debug_macinfo  0 : { *(.debug_macinfo) }
143  /* SGI/MIPS DWARF 2 extensions */
144  .debug_weaknames 0 : { *(.debug_weaknames) }
145  .debug_funcnames 0 : { *(.debug_funcnames) }
146  .debug_typenames 0 : { *(.debug_typenames) }
147  .debug_varnames  0 : { *(.debug_varnames) }
148  /* These must appear regardless of  .  */
149}
150