blob: 10513abd2c5c46e35d0f4d32438f0c57f3d8bb86 [file] [log] [blame]
Gabor Juhoscb5dbca2013-01-30 04:31:52 +00001/*
2 * (C) Copyright 2003
3 * Wolfgang Denk Engineering, <wd@denx.de>
4 *
5 * See file CREDITS for list of people who contributed to this
6 * project.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21 * MA 02111-1307 USA
22 */
23
24#if defined(CONFIG_64BIT)
25#define PTR_COUNT_SHIFT 3
26#else
27#define PTR_COUNT_SHIFT 2
28#endif
29
30OUTPUT_ARCH(mips)
31ENTRY(_start)
32SECTIONS
33{
34 . = 0x00000000;
35
36 . = ALIGN(4);
37 .text : {
38 *(.text*)
39 }
40
41 . = ALIGN(4);
42 .rodata : {
43 *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
44 }
45
46 . = ALIGN(4);
47 .data : {
48 *(.data*)
49 }
50
51 . = .;
52 _gp = ALIGN(16) + 0x7ff0;
53
54 .got : {
Gabor Juhoscb5dbca2013-01-30 04:31:52 +000055 *(.got)
Gabor Juhoscb5dbca2013-01-30 04:31:52 +000056 }
57
Gabor Juhos45397812013-02-12 22:22:12 +010058 num_got_entries = SIZEOF(.got) >> PTR_COUNT_SHIFT;
59
Gabor Juhoscb5dbca2013-01-30 04:31:52 +000060 . = ALIGN(4);
61 .sdata : {
62 *(.sdata*)
63 }
64
65 . = ALIGN(4);
66 .u_boot_list : {
67 #include <u-boot.lst>
68 }
69
Gabor Juhoscb5dbca2013-01-30 04:31:52 +000070 . = ALIGN(4);
Daniel Schwierzeck3420bf12013-02-12 22:22:12 +010071 __image_copy_end = .;
72
Gabor Juhos0ba89262013-02-12 22:22:13 +010073 .rel.dyn : {
74 __rel_dyn_start = .;
75 *(.rel.dyn)
76 __rel_dyn_end = .;
77 }
78
79 .deadcode : {
80 /*
81 * Workaround for a binutils feature (or bug?).
82 *
83 * The GNU ld from binutils puts the dynamic relocation
84 * entries into the .rel.dyn section. Sometimes it
85 * allocates more dynamic relocation entries than it needs
86 * and the unused slots are set to R_MIPS_NONE entries.
87 *
88 * However the size of the .rel.dyn section in the ELF
89 * section header does not cover the unused entries, so
90 * objcopy removes those during stripping.
91 *
92 * Create a small section here to avoid that.
93 */
94 LONG(0xffffffff);
95 }
96
97 .dynsym : {
98 *(.dynsym)
99 }
100
101 .bss __rel_dyn_start (OVERLAY) : {
Daniel Schwierzecka52852c2013-02-12 22:22:12 +0100102 __bss_start = .;
103 *(.sbss.*)
104 *(.bss.*)
105 *(COMMON)
106 . = ALIGN(4);
107 __bss_end = .;
Gabor Juhoscb5dbca2013-01-30 04:31:52 +0000108 }
Gabor Juhos0ba89262013-02-12 22:22:13 +0100109
110 /DISCARD/ : {
111 *(.dynbss)
112 *(.dynstr)
113 *(.dynamic)
114 *(.interp)
115 *(.hash)
116 *(.gnu.*)
117 *(.plt)
118 *(.got.plt)
119 *(.rel.plt)
120 }
Gabor Juhoscb5dbca2013-01-30 04:31:52 +0000121}