xref: /freebsd/sys/conf/ldscript.arm64 (revision 8bcb0991864975618c09697b1aca10683346d9f0)
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  .data1   : { *(.data1) }
86  . = ALIGN(32 / 8);
87  _start_ctors = .;
88  PROVIDE (start_ctors = .);
89  .ctors         :
90  {
91    *(.ctors)
92  }
93  _stop_ctors = .;
94  PROVIDE (stop_ctors = .);
95  .dtors         :
96  {
97    *(.dtors)
98  }
99  .got           : { *(.got.plt) *(.got) }
100  .dynamic       : { *(.dynamic) }
101  /* We want the small data sections together, so single-instruction offsets
102     can access them all, and initialized data all before uninitialized, so
103     we can shorten the on-disk segment size.  */
104  . = ALIGN(8);
105  .sdata     : { *(.sdata) }
106  _edata  =  .;
107  PROVIDE (edata = .);
108  __bss_start = .;
109  .sbss      : { *(.sbss) *(.scommon) }
110  .bss       :
111  {
112   *(.dynbss)
113   *(.bss)
114   *(COMMON)
115  }
116  . = ALIGN(8);
117  _end = . ;
118  PROVIDE (end = .);
119  /* Stabs debugging sections.  */
120  .stab 0 : { *(.stab) }
121  .stabstr 0 : { *(.stabstr) }
122  .stab.excl 0 : { *(.stab.excl) }
123  .stab.exclstr 0 : { *(.stab.exclstr) }
124  .stab.index 0 : { *(.stab.index) }
125  .stab.indexstr 0 : { *(.stab.indexstr) }
126  .comment 0 : { *(.comment) }
127  /* DWARF debug sections.
128     Symbols in the DWARF debugging sections are relative to the beginning
129     of the section so we begin them at 0.  */
130  /* DWARF 1 */
131  .debug          0 : { *(.debug) }
132  .line           0 : { *(.line) }
133  /* GNU DWARF 1 extensions */
134  .debug_srcinfo  0 : { *(.debug_srcinfo) }
135  .debug_sfnames  0 : { *(.debug_sfnames) }
136  /* DWARF 1.1 and DWARF 2 */
137  .debug_aranges  0 : { *(.debug_aranges) }
138  .debug_pubnames 0 : { *(.debug_pubnames) }
139  /* DWARF 2 */
140  .debug_info     0 : { *(.debug_info) }
141  .debug_abbrev   0 : { *(.debug_abbrev) }
142  .debug_line     0 : { *(.debug_line) }
143  .debug_frame    0 : { *(.debug_frame) }
144  .debug_str      0 : { *(.debug_str) }
145  .debug_loc      0 : { *(.debug_loc) }
146  .debug_macinfo  0 : { *(.debug_macinfo) }
147  /* SGI/MIPS DWARF 2 extensions */
148  .debug_weaknames 0 : { *(.debug_weaknames) }
149  .debug_funcnames 0 : { *(.debug_funcnames) }
150  .debug_typenames 0 : { *(.debug_typenames) }
151  .debug_varnames  0 : { *(.debug_varnames) }
152  /* These must appear regardless of  .  */
153}
154