xref: /freebsd/sys/conf/ldscript.arm64 (revision 024248c933c5741a21c17eda63092f330dd98337)
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  .vmm_vectors : { *(.vmm_vectors) }
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
21  .fini      : { *(.fini)    } =0x9090
22  .rodata    : { *(.rodata*) *(.gnu.linkonce.r*) }
23  .rodata1   : { *(.rodata1) }
24   .interp     : { *(.interp) 	}
25  .hash          : { *(.hash)		}
26  .dynsym        : { *(.dynsym)		}
27  .dynstr        : { *(.dynstr)		}
28  .gnu.version   : { *(.gnu.version)	}
29  .gnu.version_d   : { *(.gnu.version_d)	}
30  .gnu.version_r   : { *(.gnu.version_r)	}
31  .note.gnu.build-id : {
32    PROVIDE (__build_id_start = .);
33    *(.note.gnu.build-id)
34    PROVIDE (__build_id_end = .);
35  }
36  .rel.text      :
37    { *(.rel.text) *(.rel.gnu.linkonce.t*) }
38  .rela.text     :
39    { *(.rela.text) *(.rela.gnu.linkonce.t*) }
40  .rel.data      :
41    { *(.rel.data) *(.rel.gnu.linkonce.d*) }
42  .rela.data     :
43    { *(.rela.data) *(.rela.gnu.linkonce.d*) }
44  .rel.rodata    :
45    { *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
46  .rela.rodata   :
47    { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
48  .rel.got       : { *(.rel.got)		}
49  .rela.got      : { *(.rela.got)		}
50  .rel.ctors     : { *(.rel.ctors)	}
51  .rela.ctors    : { *(.rela.ctors)	}
52  .rel.dtors     : { *(.rel.dtors)	}
53  .rela.dtors    : { *(.rela.dtors)	}
54  .rel.init      : { *(.rel.init)	}
55  .rela.init     : { *(.rela.init)	}
56  .rel.fini      : { *(.rel.fini)	}
57  .rela.fini     : { *(.rela.fini)	}
58  .rel.bss       : { *(.rel.bss)		}
59  .rela.bss      : { *(.rela.bss)		}
60  .rel.plt       : { *(.rel.plt)		}
61  .rela.plt      : { *(.rela.plt)		}
62  .init          : { *(.init)	} =0x9090
63  .plt      : { *(.plt)	}
64
65  . = ALIGN(4);
66  _extab_start = .;
67  PROVIDE(extab_start = .);
68  .ARM.extab : { *(.ARM.extab) }
69  _extab.end = .;
70  PROVIDE(extab_end = .);
71
72  _exidx_start = .;
73  PROVIDE(exidx_start = .);
74  .ARM.exidx : { *(.ARM.exidx) }
75  _exidx_end = .;
76  PROVIDE(exidx_end = .);
77
78  /* Adjust the address for the data segment.  We want to adjust up to
79     the same address within the page on the next page up.  */
80  . = ALIGN(0x1000) + (. & (0x1000 - 1)) ;
81  .data    :
82  {
83    *(.data)
84    *(.gnu.linkonce.d*)
85  }
86  . = ALIGN(128);
87  .data.read_frequently :
88  {
89    *(SORT_BY_ALIGNMENT(.data.read_frequently))
90  }
91  .data.read_mostly :
92  {
93    *(.data.read_mostly)
94  }
95  . = ALIGN(128);
96  .data.exclusive_cache_line :
97  {
98    *(.data.exclusive_cache_line)
99  }
100  . = ALIGN(128);
101  .data1   : { *(.data1) }
102  . = ALIGN(32 / 8);
103  _start_ctors = .;
104  PROVIDE (start_ctors = .);
105  .ctors         :
106  {
107    *(.ctors)
108  }
109  _stop_ctors = .;
110  PROVIDE (stop_ctors = .);
111  .dtors         :
112  {
113    *(.dtors)
114  }
115  .got           : { *(.got.plt) *(.got) }
116  .dynamic       : { *(.dynamic) }
117  /* We want the small data sections together, so single-instruction offsets
118     can access them all, and initialized data all before uninitialized, so
119     we can shorten the on-disk segment size.  */
120  . = ALIGN(8);
121  .sdata     : { *(.sdata) }
122  _edata  =  .;
123  PROVIDE (edata = .);
124  . = ALIGN(16);
125  __bss_start = .;
126  .sbss      : { *(.sbss) *(.scommon) }
127  .bss       :
128  {
129   *(.dynbss)
130   *(.bss)
131   *(COMMON)
132   . = ALIGN(16);
133   __bss_end = .;
134   /* A section for the initial page table, it doesn't need to be in the
135      kernel file, however unlike normal .bss entries should not be zeroed
136      out as we use it before the .bss section is cleared. */
137   *(.init_pagetable)
138  }
139  _end = . ;
140  PROVIDE (end = .);
141
142  /* Debug */
143  INCLUDE debuginfo.ldscript
144
145  .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
146  /DISCARD/ : { *(.note.GNU-stack) }
147}
148