blob: 0129c996118d621e913b097d433637e6503d25d0 [file] [log] [blame]
Gabor Juhoscb5dbca2013-01-30 04:31:52 +00001/*
2 * (C) Copyright 2003
3 * Wolfgang Denk Engineering, <wd@denx.de>
4 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Gabor Juhoscb5dbca2013-01-30 04:31:52 +00006 */
7
8#if defined(CONFIG_64BIT)
9#define PTR_COUNT_SHIFT 3
10#else
11#define PTR_COUNT_SHIFT 2
12#endif
13
14OUTPUT_ARCH(mips)
15ENTRY(_start)
16SECTIONS
17{
18 . = 0x00000000;
19
20 . = ALIGN(4);
21 .text : {
Paul Burtond263cda2016-09-21 11:11:06 +010022 __text_start = .;
Gabor Juhoscb5dbca2013-01-30 04:31:52 +000023 *(.text*)
Paul Burtond263cda2016-09-21 11:11:06 +010024 __text_end = .;
Gabor Juhoscb5dbca2013-01-30 04:31:52 +000025 }
26
27 . = ALIGN(4);
28 .rodata : {
29 *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
30 }
31
32 . = ALIGN(4);
33 .data : {
34 *(.data*)
35 }
36
37 . = .;
38 _gp = ALIGN(16) + 0x7ff0;
39
40 .got : {
Gabor Juhoscb5dbca2013-01-30 04:31:52 +000041 *(.got)
Gabor Juhoscb5dbca2013-01-30 04:31:52 +000042 }
43
Gabor Juhos45397812013-02-12 22:22:12 +010044 num_got_entries = SIZEOF(.got) >> PTR_COUNT_SHIFT;
45
Gabor Juhoscb5dbca2013-01-30 04:31:52 +000046 . = ALIGN(4);
47 .sdata : {
48 *(.sdata*)
49 }
50
51 . = ALIGN(4);
52 .u_boot_list : {
Albert ARIBAUDef123c52013-02-25 00:59:00 +000053 KEEP(*(SORT(.u_boot_list*)));
Gabor Juhoscb5dbca2013-01-30 04:31:52 +000054 }
55
Gabor Juhoscb5dbca2013-01-30 04:31:52 +000056 . = ALIGN(4);
Daniel Schwierzeck3420bf12013-02-12 22:22:12 +010057 __image_copy_end = .;
Paul Burtona0af08b2014-04-07 10:11:19 +010058 __init_end = .;
Daniel Schwierzeck3420bf12013-02-12 22:22:12 +010059
Gabor Juhos0ba89262013-02-12 22:22:13 +010060 .rel.dyn : {
61 __rel_dyn_start = .;
62 *(.rel.dyn)
63 __rel_dyn_end = .;
64 }
65
Daniel Schwierzeck265072b2014-10-29 17:30:36 +010066 .padding : {
67 /*
68 * Workaround for a binutils feature (or bug?).
69 *
70 * The GNU ld from binutils puts the dynamic relocation
71 * entries into the .rel.dyn section. Sometimes it
72 * allocates more dynamic relocation entries than it needs
73 * and the unused slots are set to R_MIPS_NONE entries.
74 *
75 * However the size of the .rel.dyn section in the ELF
76 * section header does not cover the unused entries, so
77 * objcopy removes those during stripping.
78 *
79 * Create a small section here to avoid that.
80 */
81 LONG(0xFFFFFFFF)
82 }
83
Daniel Schwierzeck79fd7e62013-10-11 17:46:59 +020084 _end = .;
Gabor Juhos0ba89262013-02-12 22:22:13 +010085
86 .bss __rel_dyn_start (OVERLAY) : {
Daniel Schwierzecka52852c2013-02-12 22:22:12 +010087 __bss_start = .;
88 *(.sbss.*)
89 *(.bss.*)
90 *(COMMON)
91 . = ALIGN(4);
92 __bss_end = .;
Gabor Juhoscb5dbca2013-01-30 04:31:52 +000093 }
Gabor Juhos0ba89262013-02-12 22:22:13 +010094
Daniel Schwierzeck79fd7e62013-10-11 17:46:59 +020095 .dynsym _end : {
96 *(.dynsym)
97 }
98
99 .dynbss : {
Gabor Juhos0ba89262013-02-12 22:22:13 +0100100 *(.dynbss)
Daniel Schwierzeck79fd7e62013-10-11 17:46:59 +0200101 }
102
103 .dynstr : {
Gabor Juhos0ba89262013-02-12 22:22:13 +0100104 *(.dynstr)
Daniel Schwierzeck79fd7e62013-10-11 17:46:59 +0200105 }
106
107 .dynamic : {
Gabor Juhos0ba89262013-02-12 22:22:13 +0100108 *(.dynamic)
Daniel Schwierzeck79fd7e62013-10-11 17:46:59 +0200109 }
110
111 .plt : {
Gabor Juhos0ba89262013-02-12 22:22:13 +0100112 *(.plt)
Daniel Schwierzeck79fd7e62013-10-11 17:46:59 +0200113 }
114
115 .interp : {
116 *(.interp)
117 }
118
119 .gnu : {
120 *(.gnu*)
121 }
122
123 .MIPS.stubs : {
124 *(.MIPS.stubs)
125 }
126
127 .hash : {
128 *(.hash)
Gabor Juhos0ba89262013-02-12 22:22:13 +0100129 }
Gabor Juhoscb5dbca2013-01-30 04:31:52 +0000130}