blob: 0129c996118d621e913b097d433637e6503d25d0 [file] [log] [blame]
Gabor Juhos7f444662013-01-30 04:31:52 +00001/*
2 * (C) Copyright 2003
3 * Wolfgang Denk Engineering, <wd@denx.de>
4 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Gabor Juhos7f444662013-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 Burton92a06ee2016-09-21 11:11:06 +010022 __text_start = .;
Gabor Juhos7f444662013-01-30 04:31:52 +000023 *(.text*)
Paul Burton92a06ee2016-09-21 11:11:06 +010024 __text_end = .;
Gabor Juhos7f444662013-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 Juhos7f444662013-01-30 04:31:52 +000041 *(.got)
Gabor Juhos7f444662013-01-30 04:31:52 +000042 }
43
Gabor Juhos7092ce82013-02-12 22:22:12 +010044 num_got_entries = SIZEOF(.got) >> PTR_COUNT_SHIFT;
45
Gabor Juhos7f444662013-01-30 04:31:52 +000046 . = ALIGN(4);
47 .sdata : {
48 *(.sdata*)
49 }
50
51 . = ALIGN(4);
52 .u_boot_list : {
Albert ARIBAUDc24895e2013-02-25 00:59:00 +000053 KEEP(*(SORT(.u_boot_list*)));
Gabor Juhos7f444662013-01-30 04:31:52 +000054 }
55
Gabor Juhos7f444662013-01-30 04:31:52 +000056 . = ALIGN(4);
Daniel Schwierzeck9049d032013-02-12 22:22:12 +010057 __image_copy_end = .;
Paul Burtond0589bb2014-04-07 10:11:19 +010058 __init_end = .;
Daniel Schwierzeck9049d032013-02-12 22:22:12 +010059
Gabor Juhos44ea3c32013-02-12 22:22:13 +010060 .rel.dyn : {
61 __rel_dyn_start = .;
62 *(.rel.dyn)
63 __rel_dyn_end = .;
64 }
65
Daniel Schwierzeck4e6cdff2014-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 Schwierzeck1263ea82013-10-11 17:46:59 +020084 _end = .;
Gabor Juhos44ea3c32013-02-12 22:22:13 +010085
86 .bss __rel_dyn_start (OVERLAY) : {
Daniel Schwierzeck56b5ec72013-02-12 22:22:12 +010087 __bss_start = .;
88 *(.sbss.*)
89 *(.bss.*)
90 *(COMMON)
Gabor Juhos7f444662013-01-30 04:31:52 +000091 . = ALIGN(4);
Daniel Schwierzeck56b5ec72013-02-12 22:22:12 +010092 __bss_end = .;
Gabor Juhos7f444662013-01-30 04:31:52 +000093 }
Gabor Juhos44ea3c32013-02-12 22:22:13 +010094
Daniel Schwierzeck1263ea82013-10-11 17:46:59 +020095 .dynsym _end : {
96 *(.dynsym)
97 }
98
99 .dynbss : {
Gabor Juhos44ea3c32013-02-12 22:22:13 +0100100 *(.dynbss)
Daniel Schwierzeck1263ea82013-10-11 17:46:59 +0200101 }
102
103 .dynstr : {
Gabor Juhos44ea3c32013-02-12 22:22:13 +0100104 *(.dynstr)
Daniel Schwierzeck1263ea82013-10-11 17:46:59 +0200105 }
106
107 .dynamic : {
Gabor Juhos44ea3c32013-02-12 22:22:13 +0100108 *(.dynamic)
Daniel Schwierzeck1263ea82013-10-11 17:46:59 +0200109 }
110
111 .plt : {
112 *(.plt)
113 }
114
115 .interp : {
Gabor Juhos44ea3c32013-02-12 22:22:13 +0100116 *(.interp)
Daniel Schwierzeck1263ea82013-10-11 17:46:59 +0200117 }
118
119 .gnu : {
120 *(.gnu*)
121 }
122
123 .MIPS.stubs : {
124 *(.MIPS.stubs)
125 }
126
127 .hash : {
Gabor Juhos44ea3c32013-02-12 22:22:13 +0100128 *(.hash)
Gabor Juhos44ea3c32013-02-12 22:22:13 +0100129 }
Gabor Juhos7f444662013-01-30 04:31:52 +0000130}