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