Gabor Juhos | 7f44466 | 2013-01-30 04:31:52 +0000 | [diff] [blame] | 1 | /* |
2 | * (C) Copyright 2003 | ||||
3 | * Wolfgang Denk Engineering, <wd@denx.de> | ||||
4 | * | ||||
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
Gabor Juhos | 7f44466 | 2013-01-30 04:31:52 +0000 | [diff] [blame] | 6 | */ |
7 | |||||
8 | #if defined(CONFIG_64BIT) | ||||
9 | #define PTR_COUNT_SHIFT 3 | ||||
10 | #else | ||||
11 | #define PTR_COUNT_SHIFT 2 | ||||
12 | #endif | ||||
13 | |||||
14 | OUTPUT_ARCH(mips) | ||||
15 | ENTRY(_start) | ||||
16 | SECTIONS | ||||
17 | { | ||||
18 | . = 0x00000000; | ||||
19 | |||||
20 | . = ALIGN(4); | ||||
21 | .text : { | ||||
22 | *(.text*) | ||||
23 | } | ||||
24 | |||||
25 | . = ALIGN(4); | ||||
26 | .rodata : { | ||||
27 | *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) | ||||
28 | } | ||||
29 | |||||
30 | . = ALIGN(4); | ||||
31 | .data : { | ||||
32 | *(.data*) | ||||
33 | } | ||||
34 | |||||
35 | . = .; | ||||
36 | _gp = ALIGN(16) + 0x7ff0; | ||||
37 | |||||
38 | .got : { | ||||
Gabor Juhos | 7f44466 | 2013-01-30 04:31:52 +0000 | [diff] [blame] | 39 | *(.got) |
Gabor Juhos | 7f44466 | 2013-01-30 04:31:52 +0000 | [diff] [blame] | 40 | } |
41 | |||||
Gabor Juhos | 7092ce8 | 2013-02-12 22:22:12 +0100 | [diff] [blame] | 42 | num_got_entries = SIZEOF(.got) >> PTR_COUNT_SHIFT; |
43 | |||||
Gabor Juhos | 7f44466 | 2013-01-30 04:31:52 +0000 | [diff] [blame] | 44 | . = ALIGN(4); |
45 | .sdata : { | ||||
46 | *(.sdata*) | ||||
47 | } | ||||
48 | |||||
49 | . = ALIGN(4); | ||||
50 | .u_boot_list : { | ||||
Albert ARIBAUD | c24895e | 2013-02-25 00:59:00 +0000 | [diff] [blame] | 51 | KEEP(*(SORT(.u_boot_list*))); |
Gabor Juhos | 7f44466 | 2013-01-30 04:31:52 +0000 | [diff] [blame] | 52 | } |
53 | |||||
Gabor Juhos | 7f44466 | 2013-01-30 04:31:52 +0000 | [diff] [blame] | 54 | . = ALIGN(4); |
Daniel Schwierzeck | 9049d03 | 2013-02-12 22:22:12 +0100 | [diff] [blame] | 55 | __image_copy_end = .; |
Paul Burton | d0589bb | 2014-04-07 10:11:19 +0100 | [diff] [blame] | 56 | __init_end = .; |
Daniel Schwierzeck | 9049d03 | 2013-02-12 22:22:12 +0100 | [diff] [blame] | 57 | |
Gabor Juhos | 44ea3c3 | 2013-02-12 22:22:13 +0100 | [diff] [blame] | 58 | .rel.dyn : { |
59 | __rel_dyn_start = .; | ||||
60 | *(.rel.dyn) | ||||
61 | __rel_dyn_end = .; | ||||
62 | } | ||||
63 | |||||
Daniel Schwierzeck | 4e6cdff | 2014-10-29 17:30:36 +0100 | [diff] [blame] | 64 | .padding : { |
65 | /* | ||||
66 | * Workaround for a binutils feature (or bug?). | ||||
67 | * | ||||
68 | * The GNU ld from binutils puts the dynamic relocation | ||||
69 | * entries into the .rel.dyn section. Sometimes it | ||||
70 | * allocates more dynamic relocation entries than it needs | ||||
71 | * and the unused slots are set to R_MIPS_NONE entries. | ||||
72 | * | ||||
73 | * However the size of the .rel.dyn section in the ELF | ||||
74 | * section header does not cover the unused entries, so | ||||
75 | * objcopy removes those during stripping. | ||||
76 | * | ||||
77 | * Create a small section here to avoid that. | ||||
78 | */ | ||||
79 | LONG(0xFFFFFFFF) | ||||
80 | } | ||||
81 | |||||
Daniel Schwierzeck | 1263ea8 | 2013-10-11 17:46:59 +0200 | [diff] [blame] | 82 | _end = .; |
Gabor Juhos | 44ea3c3 | 2013-02-12 22:22:13 +0100 | [diff] [blame] | 83 | |
84 | .bss __rel_dyn_start (OVERLAY) : { | ||||
Daniel Schwierzeck | 56b5ec7 | 2013-02-12 22:22:12 +0100 | [diff] [blame] | 85 | __bss_start = .; |
86 | *(.sbss.*) | ||||
87 | *(.bss.*) | ||||
88 | *(COMMON) | ||||
Gabor Juhos | 7f44466 | 2013-01-30 04:31:52 +0000 | [diff] [blame] | 89 | . = ALIGN(4); |
Daniel Schwierzeck | 56b5ec7 | 2013-02-12 22:22:12 +0100 | [diff] [blame] | 90 | __bss_end = .; |
Gabor Juhos | 7f44466 | 2013-01-30 04:31:52 +0000 | [diff] [blame] | 91 | } |
Gabor Juhos | 44ea3c3 | 2013-02-12 22:22:13 +0100 | [diff] [blame] | 92 | |
Daniel Schwierzeck | 1263ea8 | 2013-10-11 17:46:59 +0200 | [diff] [blame] | 93 | .dynsym _end : { |
94 | *(.dynsym) | ||||
95 | } | ||||
96 | |||||
97 | .dynbss : { | ||||
Gabor Juhos | 44ea3c3 | 2013-02-12 22:22:13 +0100 | [diff] [blame] | 98 | *(.dynbss) |
Daniel Schwierzeck | 1263ea8 | 2013-10-11 17:46:59 +0200 | [diff] [blame] | 99 | } |
100 | |||||
101 | .dynstr : { | ||||
Gabor Juhos | 44ea3c3 | 2013-02-12 22:22:13 +0100 | [diff] [blame] | 102 | *(.dynstr) |
Daniel Schwierzeck | 1263ea8 | 2013-10-11 17:46:59 +0200 | [diff] [blame] | 103 | } |
104 | |||||
105 | .dynamic : { | ||||
Gabor Juhos | 44ea3c3 | 2013-02-12 22:22:13 +0100 | [diff] [blame] | 106 | *(.dynamic) |
Daniel Schwierzeck | 1263ea8 | 2013-10-11 17:46:59 +0200 | [diff] [blame] | 107 | } |
108 | |||||
109 | .plt : { | ||||
110 | *(.plt) | ||||
111 | } | ||||
112 | |||||
113 | .interp : { | ||||
Gabor Juhos | 44ea3c3 | 2013-02-12 22:22:13 +0100 | [diff] [blame] | 114 | *(.interp) |
Daniel Schwierzeck | 1263ea8 | 2013-10-11 17:46:59 +0200 | [diff] [blame] | 115 | } |
116 | |||||
117 | .gnu : { | ||||
118 | *(.gnu*) | ||||
119 | } | ||||
120 | |||||
121 | .MIPS.stubs : { | ||||
122 | *(.MIPS.stubs) | ||||
123 | } | ||||
124 | |||||
125 | .hash : { | ||||
Gabor Juhos | 44ea3c3 | 2013-02-12 22:22:13 +0100 | [diff] [blame] | 126 | *(.hash) |
Gabor Juhos | 44ea3c3 | 2013-02-12 22:22:13 +0100 | [diff] [blame] | 127 | } |
Gabor Juhos | 7f44466 | 2013-01-30 04:31:52 +0000 | [diff] [blame] | 128 | } |