blob: 9b7171a0ec6996d635fc0e9b031c0e02262370a8 [file] [log] [blame]
Ben Cheng7823f2a2014-04-08 14:53:42 -07001/* Script for ld -r: link without relocation */
2OUTPUT_FORMAT("elf32-littleaarch64", "elf32-bigaarch64",
3 "elf32-littleaarch64")
4OUTPUT_ARCH(aarch64:ilp32)
5 /* For some reason, the Solaris linker makes bad executables
6 if gld -r is used and the intermediate file has sections starting
7 at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
8 bug. But for now assigning the zero vmas works. */
9SECTIONS
10{
11 /* Read-only sections, merged into text segment: */
12 .interp 0 : { *(.interp) }
13 .note.gnu.build-id : { *(.note.gnu.build-id) }
14 .hash 0 : { *(.hash) }
15 .gnu.hash 0 : { *(.gnu.hash) }
16 .dynsym 0 : { *(.dynsym) }
17 .dynstr 0 : { *(.dynstr) }
18 .gnu.version 0 : { *(.gnu.version) }
19 .gnu.version_d 0: { *(.gnu.version_d) }
20 .gnu.version_r 0: { *(.gnu.version_r) }
21 .rela.init 0 : { *(.rela.init) }
22 .rela.text 0 : { *(.rela.text) }
23 .rela.fini 0 : { *(.rela.fini) }
24 .rela.rodata 0 : { *(.rela.rodata) }
25 .rela.data.rel.ro 0 : { *(.rela.data.rel.ro) }
26 .rela.data 0 : { *(.rela.data) }
27 .rela.tdata 0 : { *(.rela.tdata) }
28 .rela.tbss 0 : { *(.rela.tbss) }
29 .rela.ctors 0 : { *(.rela.ctors) }
30 .rela.dtors 0 : { *(.rela.dtors) }
31 .rela.got 0 : { *(.rela.got) }
32 .rela.bss 0 : { *(.rela.bss) }
33 .rela.ifunc 0 : { *(.rela.ifunc) }
34 .rela.plt 0 :
35 {
36 *(.rela.plt)
37 }
38 .init 0 :
39 {
40 KEEP (*(SORT_NONE(.init)))
41 } =0
42 .plt 0 : { *(.plt) *(.iplt) }
43 .text 0 :
44 {
45 *(.text .stub)
46 /* .gnu.warning sections are handled specially by elf32.em. */
47 *(.gnu.warning)
48 } =0
49 .fini 0 :
50 {
51 KEEP (*(SORT_NONE(.fini)))
52 } =0
53 .rodata 0 : { *(.rodata) }
54 .rodata1 0 : { *(.rodata1) }
55 .eh_frame_hdr : { *(.eh_frame_hdr) }
56 .eh_frame 0 : ONLY_IF_RO { KEEP (*(.eh_frame)) }
57 .gcc_except_table 0 : ONLY_IF_RO { *(.gcc_except_table
58 .gcc_except_table.*) }
59 /* These sections are generated by the Sun/Oracle C++ compiler. */
60 .exception_ranges 0 : ONLY_IF_RO { *(.exception_ranges
61 .exception_ranges*) }
Ben Cheng79781f52014-05-19 10:33:46 -070062 /* Adjust the address for the data segment. For 32 bits we want to align
63 at exactly a page boundary to make life easier for apriori. */
Ben Cheng7823f2a2014-04-08 14:53:42 -070064 /* Exception handling */
65 .eh_frame 0 : ONLY_IF_RW { KEEP (*(.eh_frame)) }
66 .gcc_except_table 0 : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
67 .exception_ranges 0 : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) }
68 /* Thread Local Storage sections */
69 .tdata 0 : { *(.tdata) }
70 .tbss 0 : { *(.tbss) }
Ben Cheng79781f52014-05-19 10:33:46 -070071 /* Ensure the __preinit_array_start label is properly aligned. We
72 could instead move the label definition inside the section, but
73 the linker would then create the section even if it turns out to
74 be empty, which isn't pretty. */
Ben Cheng7823f2a2014-04-08 14:53:42 -070075 .preinit_array 0 :
76 {
77 KEEP (*(.preinit_array))
78 }
79 .jcr 0 : { KEEP (*(.jcr)) }
80 .dynamic 0 : { *(.dynamic) }
81 .got 0 : { *(.got) *(.igot) }
82 .got.plt 0 : { *(.got.plt) *(.igot.plt) }
83 .data 0 :
84 {
85 *(.data)
86 }
87 .data1 0 : { *(.data1) }
88 .bss 0 :
89 {
90 *(.dynbss)
91 *(.bss)
92 *(COMMON)
93 /* Align here to ensure that the .bss section occupies space up to
94 _end. Align after .bss to ensure correct alignment even if the
Ben Cheng79781f52014-05-19 10:33:46 -070095 .bss section disappears because there are no input sections. */
Ben Cheng7823f2a2014-04-08 14:53:42 -070096 }
97 /* Stabs debugging sections. */
98 .stab 0 : { *(.stab) }
99 .stabstr 0 : { *(.stabstr) }
100 .stab.excl 0 : { *(.stab.excl) }
101 .stab.exclstr 0 : { *(.stab.exclstr) }
102 .stab.index 0 : { *(.stab.index) }
103 .stab.indexstr 0 : { *(.stab.indexstr) }
104 .comment 0 : { *(.comment) }
105 /* DWARF debug sections.
106 Symbols in the DWARF debugging sections are relative to the beginning
107 of the section so we begin them at 0. */
108 /* DWARF 1 */
109 .debug 0 : { *(.debug) }
110 .line 0 : { *(.line) }
111 /* GNU DWARF 1 extensions */
112 .debug_srcinfo 0 : { *(.debug_srcinfo) }
113 .debug_sfnames 0 : { *(.debug_sfnames) }
114 /* DWARF 1.1 and DWARF 2 */
115 .debug_aranges 0 : { *(.debug_aranges) }
116 .debug_pubnames 0 : { *(.debug_pubnames) }
117 /* DWARF 2 */
118 .debug_info 0 : { *(.debug_info) }
119 .debug_abbrev 0 : { *(.debug_abbrev) }
120 .debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end ) }
121 .debug_frame 0 : { *(.debug_frame) }
122 .debug_str 0 : { *(.debug_str) }
123 .debug_loc 0 : { *(.debug_loc) }
124 .debug_macinfo 0 : { *(.debug_macinfo) }
125 /* SGI/MIPS DWARF 2 extensions */
126 .debug_weaknames 0 : { *(.debug_weaknames) }
127 .debug_funcnames 0 : { *(.debug_funcnames) }
128 .debug_typenames 0 : { *(.debug_typenames) }
129 .debug_varnames 0 : { *(.debug_varnames) }
130 /* DWARF 3 */
131 .debug_pubtypes 0 : { *(.debug_pubtypes) }
132 .debug_ranges 0 : { *(.debug_ranges) }
133 /* DWARF Extension. */
134 .debug_macro 0 : { *(.debug_macro) }
135 .stack 0 :
136 {
137 *(.stack)
138 }
139 .ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }
140 .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }
141}