1 /* -----------------------------------------------------------------------
3 * Copyright 2009 Intel Corporation; author: H. Peter Anvin
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
8 * Boston MA 02110-1301, USA; either version 2 of the License, or
9 * (at your option) any later version; incorporated herein by reference.
11 * ----------------------------------------------------------------------- */
14 * Linker script for MEMDISK
17 /* Script for -z combreloc: combine and sort reloc sections */
18 OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
24 /* Read-only sections, merged into text segment: */
26 PROVIDE (__executable_start = .);
34 *(.text .stub .text.* .gnu.linkonce.t.*)
35 /* .gnu.warning sections are handled specially by elf32.em. */
42 PROVIDE (__etext = .);
45 .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
46 .rodata1 : { *(.rodata1) }
48 /* Ensure the __preinit_array_start label is properly aligned. We
49 could instead move the label definition inside the section, but
50 the linker would then create the section even if it turns out to
51 be empty, which isn't pretty. */
53 PROVIDE (__preinit_array_start = .);
54 .preinit_array : { *(.preinit_array) }
55 PROVIDE (__preinit_array_end = .);
56 PROVIDE (__init_array_start = .);
57 .init_array : { *(.init_array) }
58 PROVIDE (__init_array_end = .);
59 PROVIDE (__fini_array_start = .);
60 .fini_array : { *(.fini_array) }
61 PROVIDE (__fini_array_end = .);
62 PROVIDE (__ctors_start = .);
65 KEEP (*(SORT(.ctors.*)))
68 PROVIDE (__ctors_end = .);
69 PROVIDE (__dtors_start = .);
72 KEEP (*(SORT(.dtors.*)))
75 PROVIDE (__dtors_end = .);
77 /* Adjust the address for the data segment. Avoid mixing code and
78 data within same 128-byte chunk. */
83 *(.data .data.* .gnu.linkonce.d.*)
86 .data1 : { *(.data1) }
94 *(.bss .bss.* .gnu.linkonce.b.*)
96 /* Align here to ensure that the .bss section occupies space up to
97 _end. Align after .bss to ensure correct alignment even if the
98 .bss section disappears because there are no input sections. */
106 /* Stabs debugging sections. */
107 .stab 0 : { *(.stab) }
108 .stabstr 0 : { *(.stabstr) }
109 .stab.excl 0 : { *(.stab.excl) }
110 .stab.exclstr 0 : { *(.stab.exclstr) }
111 .stab.index 0 : { *(.stab.index) }
112 .stab.indexstr 0 : { *(.stab.indexstr) }
113 .comment 0 : { *(.comment) }
114 /* DWARF debug sections.
115 Symbols in the DWARF debugging sections are relative to the beginning
116 of the section so we begin them at 0. */
118 .debug 0 : { *(.debug) }
119 .line 0 : { *(.line) }
120 /* GNU DWARF 1 extensions */
121 .debug_srcinfo 0 : { *(.debug_srcinfo) }
122 .debug_sfnames 0 : { *(.debug_sfnames) }
123 /* DWARF 1.1 and DWARF 2 */
124 .debug_aranges 0 : { *(.debug_aranges) }
125 .debug_pubnames 0 : { *(.debug_pubnames) }
127 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
128 .debug_abbrev 0 : { *(.debug_abbrev) }
129 .debug_line 0 : { *(.debug_line) }
130 .debug_frame 0 : { *(.debug_frame) }
131 .debug_str 0 : { *(.debug_str) }
132 .debug_loc 0 : { *(.debug_loc) }
133 .debug_macinfo 0 : { *(.debug_macinfo) }
134 /* SGI/MIPS DWARF 2 extensions */
135 .debug_weaknames 0 : { *(.debug_weaknames) }
136 .debug_funcnames 0 : { *(.debug_funcnames) }
137 .debug_typenames 0 : { *(.debug_typenames) }
138 .debug_varnames 0 : { *(.debug_varnames) }
139 /DISCARD/ : { *(.note.GNU-stack) }