root / m68k.ld @ f36672ae
History | View | Annotate | Download (5.9 kB)
1 | 38e584a0 | bellard | /* Script for -z combreloc: combine and sort reloc sections */ |
---|---|---|---|
2 | 38e584a0 | bellard | OUTPUT_FORMAT("elf32-m68k", "elf32-m68k", |
3 | 38e584a0 | bellard | "elf32-m68k") |
4 | 38e584a0 | bellard | OUTPUT_ARCH(m68k) |
5 | 38e584a0 | bellard | ENTRY(_start) |
6 | 38e584a0 | bellard | SEARCH_DIR("/usr/local/m68k-linux/lib"); |
7 | 38e584a0 | bellard | /* Do we need any of these for elf? |
8 | 38e584a0 | bellard | __DYNAMIC = 0; */ |
9 | 38e584a0 | bellard | SECTIONS |
10 | 38e584a0 | bellard | { |
11 | 38e584a0 | bellard | /* Read-only sections, merged into text segment: */ |
12 | 38e584a0 | bellard | . = 0x60000000 + SIZEOF_HEADERS; |
13 | 38e584a0 | bellard | .interp : { *(.interp) } |
14 | 38e584a0 | bellard | .hash : { *(.hash) } |
15 | 38e584a0 | bellard | .dynsym : { *(.dynsym) } |
16 | 38e584a0 | bellard | .dynstr : { *(.dynstr) } |
17 | 38e584a0 | bellard | .gnu.version : { *(.gnu.version) } |
18 | 38e584a0 | bellard | .gnu.version_d : { *(.gnu.version_d) } |
19 | 38e584a0 | bellard | .gnu.version_r : { *(.gnu.version_r) } |
20 | 38e584a0 | bellard | .rel.dyn : |
21 | 38e584a0 | bellard | { |
22 | 38e584a0 | bellard | *(.rel.init) |
23 | 38e584a0 | bellard | *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) |
24 | 38e584a0 | bellard | *(.rel.fini) |
25 | 38e584a0 | bellard | *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) |
26 | 38e584a0 | bellard | *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) |
27 | 38e584a0 | bellard | *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) |
28 | 38e584a0 | bellard | *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) |
29 | 38e584a0 | bellard | *(.rel.ctors) |
30 | 38e584a0 | bellard | *(.rel.dtors) |
31 | 38e584a0 | bellard | *(.rel.got) |
32 | 38e584a0 | bellard | *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) |
33 | 38e584a0 | bellard | } |
34 | 38e584a0 | bellard | .rela.dyn : |
35 | 38e584a0 | bellard | { |
36 | 38e584a0 | bellard | *(.rela.init) |
37 | 38e584a0 | bellard | *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) |
38 | 38e584a0 | bellard | *(.rela.fini) |
39 | 38e584a0 | bellard | *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) |
40 | 38e584a0 | bellard | *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) |
41 | 38e584a0 | bellard | *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) |
42 | 38e584a0 | bellard | *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) |
43 | 38e584a0 | bellard | *(.rela.ctors) |
44 | 38e584a0 | bellard | *(.rela.dtors) |
45 | 38e584a0 | bellard | *(.rela.got) |
46 | 38e584a0 | bellard | *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) |
47 | 38e584a0 | bellard | } |
48 | 38e584a0 | bellard | .rel.plt : { *(.rel.plt) } |
49 | 38e584a0 | bellard | .rela.plt : { *(.rela.plt) } |
50 | 38e584a0 | bellard | .init : |
51 | 38e584a0 | bellard | { |
52 | 38e584a0 | bellard | KEEP (*(.init)) |
53 | 38e584a0 | bellard | } =0x4e754e75 |
54 | 38e584a0 | bellard | .plt : { *(.plt) } |
55 | 38e584a0 | bellard | .text : |
56 | 38e584a0 | bellard | { |
57 | 38e584a0 | bellard | *(.text .stub .text.* .gnu.linkonce.t.*) |
58 | 38e584a0 | bellard | /* .gnu.warning sections are handled specially by elf32.em. */ |
59 | 38e584a0 | bellard | *(.gnu.warning) |
60 | 38e584a0 | bellard | } =0x4e754e75 |
61 | 38e584a0 | bellard | .fini : |
62 | 38e584a0 | bellard | { |
63 | 38e584a0 | bellard | KEEP (*(.fini)) |
64 | 38e584a0 | bellard | } =0x4e754e75 |
65 | 38e584a0 | bellard | PROVIDE (__etext = .); |
66 | 38e584a0 | bellard | PROVIDE (_etext = .); |
67 | 38e584a0 | bellard | PROVIDE (etext = .); |
68 | 38e584a0 | bellard | .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } |
69 | 38e584a0 | bellard | .rodata1 : { *(.rodata1) } |
70 | 38e584a0 | bellard | .eh_frame_hdr : { *(.eh_frame_hdr) } |
71 | 38e584a0 | bellard | /* Adjust the address for the data segment. We want to adjust up to |
72 | 38e584a0 | bellard | the same address within the page on the next page up. */ |
73 | 38e584a0 | bellard | . = ALIGN(0x2000) + (. & (0x2000 - 1)); |
74 | 38e584a0 | bellard | /* Ensure the __preinit_array_start label is properly aligned. We |
75 | 38e584a0 | bellard | could instead move the label definition inside the section, but |
76 | 38e584a0 | bellard | the linker would then create the section even if it turns out to |
77 | 38e584a0 | bellard | be empty, which isn't pretty. */ |
78 | 38e584a0 | bellard | . = ALIGN(32 / 8); |
79 | 38e584a0 | bellard | PROVIDE (__preinit_array_start = .); |
80 | 38e584a0 | bellard | .preinit_array : { *(.preinit_array) } |
81 | 38e584a0 | bellard | PROVIDE (__preinit_array_end = .); |
82 | 38e584a0 | bellard | PROVIDE (__init_array_start = .); |
83 | 38e584a0 | bellard | .init_array : { *(.init_array) } |
84 | 38e584a0 | bellard | PROVIDE (__init_array_end = .); |
85 | 38e584a0 | bellard | PROVIDE (__fini_array_start = .); |
86 | 38e584a0 | bellard | .fini_array : { *(.fini_array) } |
87 | 38e584a0 | bellard | PROVIDE (__fini_array_end = .); |
88 | 38e584a0 | bellard | .data : |
89 | 38e584a0 | bellard | { |
90 | 38e584a0 | bellard | *(.data .data.* .gnu.linkonce.d.*) |
91 | 38e584a0 | bellard | SORT(CONSTRUCTORS) |
92 | 38e584a0 | bellard | } |
93 | 38e584a0 | bellard | .data1 : { *(.data1) } |
94 | 38e584a0 | bellard | .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } |
95 | 38e584a0 | bellard | .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } |
96 | 38e584a0 | bellard | .eh_frame : { KEEP (*(.eh_frame)) } |
97 | 38e584a0 | bellard | .gcc_except_table : { *(.gcc_except_table) } |
98 | 38e584a0 | bellard | .dynamic : { *(.dynamic) } |
99 | 38e584a0 | bellard | .ctors : |
100 | 38e584a0 | bellard | { |
101 | 38e584a0 | bellard | /* gcc uses crtbegin.o to find the start of |
102 | 38e584a0 | bellard | the constructors, so we make sure it is |
103 | 38e584a0 | bellard | first. Because this is a wildcard, it |
104 | 38e584a0 | bellard | doesn't matter if the user does not |
105 | 38e584a0 | bellard | actually link against crtbegin.o; the |
106 | 38e584a0 | bellard | linker won't look for a file to match a |
107 | 38e584a0 | bellard | wildcard. The wildcard also means that it |
108 | 38e584a0 | bellard | doesn't matter which directory crtbegin.o |
109 | 38e584a0 | bellard | is in. */ |
110 | 38e584a0 | bellard | KEEP (*crtbegin.o(.ctors)) |
111 | 38e584a0 | bellard | /* We don't want to include the .ctor section from |
112 | 38e584a0 | bellard | from the crtend.o file until after the sorted ctors. |
113 | 38e584a0 | bellard | The .ctor section from the crtend file contains the |
114 | 38e584a0 | bellard | end of ctors marker and it must be last */ |
115 | 38e584a0 | bellard | KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors)) |
116 | 38e584a0 | bellard | KEEP (*(SORT(.ctors.*))) |
117 | 38e584a0 | bellard | KEEP (*(.ctors)) |
118 | 38e584a0 | bellard | } |
119 | 38e584a0 | bellard | .dtors : |
120 | 38e584a0 | bellard | { |
121 | 38e584a0 | bellard | KEEP (*crtbegin.o(.dtors)) |
122 | 38e584a0 | bellard | KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors)) |
123 | 38e584a0 | bellard | KEEP (*(SORT(.dtors.*))) |
124 | 38e584a0 | bellard | KEEP (*(.dtors)) |
125 | 38e584a0 | bellard | } |
126 | 38e584a0 | bellard | .jcr : { KEEP (*(.jcr)) } |
127 | 38e584a0 | bellard | .got : { *(.got.plt) *(.got) } |
128 | 38e584a0 | bellard | _edata = .; |
129 | 38e584a0 | bellard | PROVIDE (edata = .); |
130 | 38e584a0 | bellard | __bss_start = .; |
131 | 38e584a0 | bellard | .bss : |
132 | 38e584a0 | bellard | { |
133 | 38e584a0 | bellard | *(.dynbss) |
134 | 38e584a0 | bellard | *(.bss .bss.* .gnu.linkonce.b.*) |
135 | 38e584a0 | bellard | *(COMMON) |
136 | 38e584a0 | bellard | /* Align here to ensure that the .bss section occupies space up to |
137 | 38e584a0 | bellard | _end. Align after .bss to ensure correct alignment even if the |
138 | 38e584a0 | bellard | .bss section disappears because there are no input sections. */ |
139 | 38e584a0 | bellard | . = ALIGN(32 / 8); |
140 | 38e584a0 | bellard | } |
141 | 38e584a0 | bellard | . = ALIGN(32 / 8); |
142 | 38e584a0 | bellard | _end = .; |
143 | 38e584a0 | bellard | PROVIDE (end = .); |
144 | 38e584a0 | bellard | /* Stabs debugging sections. */ |
145 | 38e584a0 | bellard | .stab 0 : { *(.stab) } |
146 | 38e584a0 | bellard | .stabstr 0 : { *(.stabstr) } |
147 | 38e584a0 | bellard | .stab.excl 0 : { *(.stab.excl) } |
148 | 38e584a0 | bellard | .stab.exclstr 0 : { *(.stab.exclstr) } |
149 | 38e584a0 | bellard | .stab.index 0 : { *(.stab.index) } |
150 | 38e584a0 | bellard | .stab.indexstr 0 : { *(.stab.indexstr) } |
151 | 38e584a0 | bellard | .comment 0 : { *(.comment) } |
152 | 38e584a0 | bellard | /* DWARF debug sections. |
153 | 38e584a0 | bellard | Symbols in the DWARF debugging sections are relative to the beginning |
154 | 38e584a0 | bellard | of the section so we begin them at 0. */ |
155 | 38e584a0 | bellard | /* DWARF 1 */ |
156 | 38e584a0 | bellard | .debug 0 : { *(.debug) } |
157 | 38e584a0 | bellard | .line 0 : { *(.line) } |
158 | 38e584a0 | bellard | /* GNU DWARF 1 extensions */ |
159 | 38e584a0 | bellard | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
160 | 38e584a0 | bellard | .debug_sfnames 0 : { *(.debug_sfnames) } |
161 | 38e584a0 | bellard | /* DWARF 1.1 and DWARF 2 */ |
162 | 38e584a0 | bellard | .debug_aranges 0 : { *(.debug_aranges) } |
163 | 38e584a0 | bellard | .debug_pubnames 0 : { *(.debug_pubnames) } |
164 | 38e584a0 | bellard | /* DWARF 2 */ |
165 | 38e584a0 | bellard | .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } |
166 | 38e584a0 | bellard | .debug_abbrev 0 : { *(.debug_abbrev) } |
167 | 38e584a0 | bellard | .debug_line 0 : { *(.debug_line) } |
168 | 38e584a0 | bellard | .debug_frame 0 : { *(.debug_frame) } |
169 | 38e584a0 | bellard | .debug_str 0 : { *(.debug_str) } |
170 | 38e584a0 | bellard | .debug_loc 0 : { *(.debug_loc) } |
171 | 38e584a0 | bellard | .debug_macinfo 0 : { *(.debug_macinfo) } |
172 | 38e584a0 | bellard | /* SGI/MIPS DWARF 2 extensions */ |
173 | 38e584a0 | bellard | .debug_weaknames 0 : { *(.debug_weaknames) } |
174 | 38e584a0 | bellard | .debug_funcnames 0 : { *(.debug_funcnames) } |
175 | 38e584a0 | bellard | .debug_typenames 0 : { *(.debug_typenames) } |
176 | 38e584a0 | bellard | .debug_varnames 0 : { *(.debug_varnames) } |
177 | 38e584a0 | bellard | } |