root / i386.ld @ 263466f5
History | View | Annotate | Download (4.4 kB)
1 | 31e31b8a | bellard | /* ld script to make i386 Linux kernel |
---|---|---|---|
2 | 31e31b8a | bellard | * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>; |
3 | 31e31b8a | bellard | */ |
4 | 31e31b8a | bellard | OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") |
5 | 31e31b8a | bellard | OUTPUT_ARCH(i386) |
6 | 31e31b8a | bellard | SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/alpha-unknown-linux-gnu/lib); |
7 | 31e31b8a | bellard | ENTRY(_start) |
8 | 31e31b8a | bellard | SECTIONS |
9 | 31e31b8a | bellard | { |
10 | 31e31b8a | bellard | /* Read-only sections, merged into text segment: */ |
11 | 31e31b8a | bellard | . = 0x60000000 + SIZEOF_HEADERS; |
12 | 31e31b8a | bellard | .interp : { *(.interp) } |
13 | 31e31b8a | bellard | .hash : { *(.hash) } |
14 | 31e31b8a | bellard | .dynsym : { *(.dynsym) } |
15 | 31e31b8a | bellard | .dynstr : { *(.dynstr) } |
16 | 31e31b8a | bellard | .gnu.version : { *(.gnu.version) } |
17 | 31e31b8a | bellard | .gnu.version_d : { *(.gnu.version_d) } |
18 | 31e31b8a | bellard | .gnu.version_r : { *(.gnu.version_r) } |
19 | 31e31b8a | bellard | .rel.text : |
20 | 31e31b8a | bellard | { *(.rel.text) *(.rel.gnu.linkonce.t*) } |
21 | 31e31b8a | bellard | .rela.text : |
22 | 31e31b8a | bellard | { *(.rela.text) *(.rela.gnu.linkonce.t*) } |
23 | 31e31b8a | bellard | .rel.data : |
24 | 31e31b8a | bellard | { *(.rel.data) *(.rel.gnu.linkonce.d*) } |
25 | 31e31b8a | bellard | .rela.data : |
26 | 31e31b8a | bellard | { *(.rela.data) *(.rela.gnu.linkonce.d*) } |
27 | 31e31b8a | bellard | .rel.rodata : |
28 | 31e31b8a | bellard | { *(.rel.rodata) *(.rel.gnu.linkonce.r*) } |
29 | 31e31b8a | bellard | .rela.rodata : |
30 | 31e31b8a | bellard | { *(.rela.rodata) *(.rela.gnu.linkonce.r*) } |
31 | 31e31b8a | bellard | .rel.got : { *(.rel.got) } |
32 | 31e31b8a | bellard | .rela.got : { *(.rela.got) } |
33 | 31e31b8a | bellard | .rel.ctors : { *(.rel.ctors) } |
34 | 31e31b8a | bellard | .rela.ctors : { *(.rela.ctors) } |
35 | 31e31b8a | bellard | .rel.dtors : { *(.rel.dtors) } |
36 | 31e31b8a | bellard | .rela.dtors : { *(.rela.dtors) } |
37 | 31e31b8a | bellard | .rel.init : { *(.rel.init) } |
38 | 31e31b8a | bellard | .rela.init : { *(.rela.init) } |
39 | 31e31b8a | bellard | .rel.fini : { *(.rel.fini) } |
40 | 31e31b8a | bellard | .rela.fini : { *(.rela.fini) } |
41 | 31e31b8a | bellard | .rel.bss : { *(.rel.bss) } |
42 | 31e31b8a | bellard | .rela.bss : { *(.rela.bss) } |
43 | 31e31b8a | bellard | .rel.plt : { *(.rel.plt) } |
44 | 31e31b8a | bellard | .rela.plt : { *(.rela.plt) } |
45 | 31e31b8a | bellard | .init : { *(.init) } =0x47ff041f |
46 | 31e31b8a | bellard | .text : |
47 | 31e31b8a | bellard | { |
48 | 31e31b8a | bellard | *(.text) |
49 | 31e31b8a | bellard | /* .gnu.warning sections are handled specially by elf32.em. */ |
50 | 31e31b8a | bellard | *(.gnu.warning) |
51 | 31e31b8a | bellard | *(.gnu.linkonce.t*) |
52 | 31e31b8a | bellard | } =0x47ff041f |
53 | 31e31b8a | bellard | _etext = .; |
54 | 31e31b8a | bellard | PROVIDE (etext = .); |
55 | 31e31b8a | bellard | .fini : { *(.fini) } =0x47ff041f |
56 | b1f64575 | bellard | . = ALIGN(32 / 8); |
57 | b1f64575 | bellard | PROVIDE (__preinit_array_start = .); |
58 | b1f64575 | bellard | .preinit_array : { *(.preinit_array) } |
59 | b1f64575 | bellard | PROVIDE (__preinit_array_end = .); |
60 | b1f64575 | bellard | PROVIDE (__init_array_start = .); |
61 | b1f64575 | bellard | .init_array : { *(.init_array) } |
62 | b1f64575 | bellard | PROVIDE (__init_array_end = .); |
63 | b1f64575 | bellard | PROVIDE (__fini_array_start = .); |
64 | b1f64575 | bellard | .fini_array : { *(.fini_array) } |
65 | b1f64575 | bellard | PROVIDE (__fini_array_end = .); |
66 | 31e31b8a | bellard | .rodata : { *(.rodata) *(.gnu.linkonce.r*) } |
67 | 31e31b8a | bellard | .rodata1 : { *(.rodata1) } |
68 | 31e31b8a | bellard | .reginfo : { *(.reginfo) } |
69 | 31e31b8a | bellard | /* Adjust the address for the data segment. We want to adjust up to |
70 | 31e31b8a | bellard | the same address within the page on the next page up. */ |
71 | 31e31b8a | bellard | . = ALIGN(0x100000) + (. & (0x100000 - 1)); |
72 | 31e31b8a | bellard | .data : |
73 | 31e31b8a | bellard | { |
74 | 31e31b8a | bellard | *(.data) |
75 | 31e31b8a | bellard | *(.gnu.linkonce.d*) |
76 | 31e31b8a | bellard | CONSTRUCTORS |
77 | 31e31b8a | bellard | } |
78 | 31e31b8a | bellard | .data1 : { *(.data1) } |
79 | 31e31b8a | bellard | .ctors : |
80 | 31e31b8a | bellard | { |
81 | 31e31b8a | bellard | *(.ctors) |
82 | 31e31b8a | bellard | } |
83 | 31e31b8a | bellard | .dtors : |
84 | 31e31b8a | bellard | { |
85 | 31e31b8a | bellard | *(.dtors) |
86 | 31e31b8a | bellard | } |
87 | 31e31b8a | bellard | .plt : { *(.plt) } |
88 | 31e31b8a | bellard | .got : { *(.got.plt) *(.got) } |
89 | 31e31b8a | bellard | .dynamic : { *(.dynamic) } |
90 | 31e31b8a | bellard | /* We want the small data sections together, so single-instruction offsets |
91 | 31e31b8a | bellard | can access them all, and initialized data all before uninitialized, so |
92 | 31e31b8a | bellard | we can shorten the on-disk segment size. */ |
93 | 31e31b8a | bellard | .sdata : { *(.sdata) } |
94 | 31e31b8a | bellard | _edata = .; |
95 | 31e31b8a | bellard | PROVIDE (edata = .); |
96 | 31e31b8a | bellard | __bss_start = .; |
97 | 31e31b8a | bellard | .sbss : { *(.sbss) *(.scommon) } |
98 | 31e31b8a | bellard | .bss : |
99 | 31e31b8a | bellard | { |
100 | 31e31b8a | bellard | *(.dynbss) |
101 | 31e31b8a | bellard | *(.bss) |
102 | 31e31b8a | bellard | *(COMMON) |
103 | 31e31b8a | bellard | } |
104 | 31e31b8a | bellard | _end = . ; |
105 | 31e31b8a | bellard | PROVIDE (end = .); |
106 | 31e31b8a | bellard | /* Stabs debugging sections. */ |
107 | 31e31b8a | bellard | .stab 0 : { *(.stab) } |
108 | 31e31b8a | bellard | .stabstr 0 : { *(.stabstr) } |
109 | 31e31b8a | bellard | .stab.excl 0 : { *(.stab.excl) } |
110 | 31e31b8a | bellard | .stab.exclstr 0 : { *(.stab.exclstr) } |
111 | 31e31b8a | bellard | .stab.index 0 : { *(.stab.index) } |
112 | 31e31b8a | bellard | .stab.indexstr 0 : { *(.stab.indexstr) } |
113 | 31e31b8a | bellard | .comment 0 : { *(.comment) } |
114 | 31e31b8a | bellard | /* DWARF debug sections. |
115 | 31e31b8a | bellard | Symbols in the DWARF debugging sections are relative to the beginning |
116 | 31e31b8a | bellard | of the section so we begin them at 0. */ |
117 | 31e31b8a | bellard | /* DWARF 1 */ |
118 | 31e31b8a | bellard | .debug 0 : { *(.debug) } |
119 | 31e31b8a | bellard | .line 0 : { *(.line) } |
120 | 31e31b8a | bellard | /* GNU DWARF 1 extensions */ |
121 | 31e31b8a | bellard | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
122 | 31e31b8a | bellard | .debug_sfnames 0 : { *(.debug_sfnames) } |
123 | 31e31b8a | bellard | /* DWARF 1.1 and DWARF 2 */ |
124 | 31e31b8a | bellard | .debug_aranges 0 : { *(.debug_aranges) } |
125 | 31e31b8a | bellard | .debug_pubnames 0 : { *(.debug_pubnames) } |
126 | 31e31b8a | bellard | /* DWARF 2 */ |
127 | 31e31b8a | bellard | .debug_info 0 : { *(.debug_info) } |
128 | 31e31b8a | bellard | .debug_abbrev 0 : { *(.debug_abbrev) } |
129 | 31e31b8a | bellard | .debug_line 0 : { *(.debug_line) } |
130 | 31e31b8a | bellard | .debug_frame 0 : { *(.debug_frame) } |
131 | 31e31b8a | bellard | .debug_str 0 : { *(.debug_str) } |
132 | 31e31b8a | bellard | .debug_loc 0 : { *(.debug_loc) } |
133 | 31e31b8a | bellard | .debug_macinfo 0 : { *(.debug_macinfo) } |
134 | 31e31b8a | bellard | /* SGI/MIPS DWARF 2 extensions */ |
135 | 31e31b8a | bellard | .debug_weaknames 0 : { *(.debug_weaknames) } |
136 | 31e31b8a | bellard | .debug_funcnames 0 : { *(.debug_funcnames) } |
137 | 31e31b8a | bellard | .debug_typenames 0 : { *(.debug_typenames) } |
138 | 31e31b8a | bellard | .debug_varnames 0 : { *(.debug_varnames) } |
139 | 31e31b8a | bellard | /* These must appear regardless of . */ |
140 | 31e31b8a | bellard | } |