xref: /freebsd/sys/conf/ldscript.arm (revision b64c5a0ace59af62eff52bfe110a521dc73c937b)
1OUTPUT_ARCH(arm)
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  . = ALIGN(4);
71  _exidx_start = .;
72  PROVIDE(exidx_start = .);
73  .ARM.exidx : { *(.ARM.exidx) }
74  _exidx_end = .;
75  PROVIDE(exidx_end = .);
76
77  . = ALIGN(0x10000);
78  .data    :
79  {
80    *(.data)
81    *(.gnu.linkonce.d*)
82  }
83  . = ALIGN(64);
84  .data.read_frequently :
85  {
86    *(SORT_BY_ALIGNMENT(.data.read_frequently))
87  }
88  .data.read_mostly :
89  {
90    *(.data.read_mostly)
91  }
92  . = ALIGN(64);
93  .data.exclusive_cache_line :
94  {
95    *(.data.exclusive_cache_line)
96  }
97  . = ALIGN(64);
98  .data1   : { *(.data1) }
99  . = ALIGN(32 / 8);
100  .init_array    :
101  {
102    PROVIDE_HIDDEN (__init_array_start = .);
103    KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*)))
104    KEEP (*(.init_array))
105    PROVIDE_HIDDEN (__init_array_end = .);
106  }
107  .fini_array    :
108  {
109    PROVIDE_HIDDEN (__fini_array_start = .);
110    KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*)))
111    KEEP (*(.fini_array))
112    PROVIDE_HIDDEN (__fini_array_end = .);
113  }
114  _start_ctors = .;
115  PROVIDE (start_ctors = .);
116  .ctors         :
117  {
118    *(.ctors)
119  }
120  _stop_ctors = .;
121  PROVIDE (stop_ctors = .);
122  .dtors         :
123  {
124    *(.dtors)
125  }
126  .got           : { *(.got.plt) *(.got) }
127  .dynamic       : { *(.dynamic) }
128  /* We want the small data sections together, so single-instruction offsets
129     can access them all, and initialized data all before uninitialized, so
130     we can shorten the on-disk segment size.  */
131  .sdata     : { *(.sdata) }
132  _edata  =  .;
133  PROVIDE (edata = .);
134  __bss_start = .;
135  .sbss      : { *(.sbss) *(.scommon) }
136  .bss       :
137  {
138   *(.dynbss)
139   *(.bss)
140   *(COMMON)
141   . = ALIGN(32 / 8);
142   _ebss = .;
143   /* A section for the initial page table, it doesn't need to be in the
144      kernel file, however unlike normal .bss entries should not be zeroed
145      out as we use it before the .bss section is cleared. */
146   *(.init_pagetable)
147  }
148  . = ALIGN(32 / 8);
149  _end = . ;
150  PROVIDE (end = .);
151
152  /* Debug */
153  INCLUDE debuginfo.ldscript
154
155  .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
156  /DISCARD/ : { *(.note.GNU-stack) }
157}
158