1/* -*- sh -*- */
2
3/*
4 * Linker script for i386 Linux images
5 *
6 */
7
8OUTPUT_FORMAT ( "elf32-i386", "elf32-i386", "elf32-i386" )
9OUTPUT_ARCH ( i386 )
10
11SECTIONS {
12	_max_align = 32;
13
14	. = 0x08048000;
15
16	/*
17	 * The text section
18	 *
19	 */
20
21	. = ALIGN ( _max_align );
22	.text : {
23		_text = .;
24		*(.text)
25		*(.text.*)
26		_etext = .;
27	}
28
29	/*
30	 * The rodata section
31	 *
32	 */
33
34	. = ALIGN ( _max_align );
35	.rodata : {
36		_rodata = .;
37		*(.rodata)
38		*(.rodata.*)
39		_erodata = .;
40	}
41
42	/*
43	 * The data section
44	 *
45	 * Adjust the address for the data segment.  We want to adjust up to
46	 * the same address within the page on the next page up.
47	 */
48
49	. = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1));
50	. = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
51	.data : {
52		_data = .;
53		*(.data)
54		*(.data.*)
55		KEEP(*(SORT(.tbl.*)))
56		KEEP(*(.provided))
57		KEEP(*(.provided.*))
58		_edata = .;
59	}
60
61	/*
62	 * The bss section
63	 *
64	 */
65
66	. = ALIGN ( _max_align );
67	.bss : {
68		_bss = .;
69		*(.bss)
70		*(.bss.*)
71		*(COMMON)
72		_ebss = .;
73	}
74
75	/*
76	 * Weak symbols that need zero values if not otherwise defined
77	 *
78	 */
79
80	.weak 0x0 : {
81		_weak = .;
82		*(.weak)
83		*(.weak.*)
84		_eweak = .;
85	}
86	_assert = ASSERT ( ( _weak == _eweak ), ".weak is non-zero length" );
87
88	/*
89	 * Dispose of the comment and note sections to make the link map
90	 * easier to read
91	 *
92	 */
93
94	/DISCARD/ : {
95		*(.comment)
96		*(.comment.*)
97		*(.note)
98		*(.note.*)
99		*(.rel)
100		*(.rel.*)
101		*(.discard)
102		*(.discard.*)
103	}
104}
105