Stefan Roese | 90c932b | 2009-10-27 16:11:26 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2007-2009 Freescale Semiconductor, Inc. |
| 3 | * |
| 4 | * See file CREDITS for list of people who contributed to this |
| 5 | * project. |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or |
| 8 | * modify it under the terms of the GNU General Public License as |
| 9 | * published by the Free Software Foundation; either version 2 of |
| 10 | * the License, or (at your option) any later version. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | * GNU General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License |
| 18 | * along with this program; if not, write to the Free Software |
| 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 20 | * MA 02111-1307 USA |
| 21 | */ |
| 22 | |
| 23 | #include "config.h" /* CONFIG_BOARDDIR */ |
| 24 | |
| 25 | #ifndef RESET_VECTOR_ADDRESS |
Ricardo Ribalda Delgado | b384381 | 2010-12-07 14:27:56 +0100 | [diff] [blame] | 26 | #ifdef CONFIG_RESET_VECTOR_ADDRESS |
| 27 | #define RESET_VECTOR_ADDRESS CONFIG_RESET_VECTOR_ADDRESS |
| 28 | #else |
Stefan Roese | 90c932b | 2009-10-27 16:11:26 +0100 | [diff] [blame] | 29 | #define RESET_VECTOR_ADDRESS 0xfffffffc |
| 30 | #endif |
Ricardo Ribalda Delgado | b384381 | 2010-12-07 14:27:56 +0100 | [diff] [blame] | 31 | #endif |
Stefan Roese | 90c932b | 2009-10-27 16:11:26 +0100 | [diff] [blame] | 32 | |
| 33 | OUTPUT_ARCH(powerpc) |
Wolfgang Denk | fe33e6e | 2010-11-21 20:55:42 +0100 | [diff] [blame] | 34 | |
Stefan Roese | 90c932b | 2009-10-27 16:11:26 +0100 | [diff] [blame] | 35 | PHDRS |
| 36 | { |
| 37 | text PT_LOAD; |
| 38 | bss PT_LOAD; |
| 39 | } |
| 40 | |
| 41 | SECTIONS |
| 42 | { |
| 43 | /* Read-only sections, merged into text segment: */ |
| 44 | . = + SIZEOF_HEADERS; |
Stefan Roese | 90c932b | 2009-10-27 16:11:26 +0100 | [diff] [blame] | 45 | .text : |
| 46 | { |
Wolfgang Denk | fe33e6e | 2010-11-21 20:55:42 +0100 | [diff] [blame] | 47 | *(.text*) |
Stefan Roese | 90c932b | 2009-10-27 16:11:26 +0100 | [diff] [blame] | 48 | } :text |
| 49 | _etext = .; |
| 50 | PROVIDE (etext = .); |
| 51 | .rodata : |
| 52 | { |
Stefan Roese | 90c932b | 2009-10-27 16:11:26 +0100 | [diff] [blame] | 53 | *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) |
| 54 | } :text |
Stefan Roese | 90c932b | 2009-10-27 16:11:26 +0100 | [diff] [blame] | 55 | |
| 56 | /* Read-write section, merged into data segment: */ |
| 57 | . = (. + 0x00FF) & 0xFFFFFF00; |
| 58 | _erotext = .; |
| 59 | PROVIDE (erotext = .); |
| 60 | .reloc : |
| 61 | { |
Stefan Roese | 90c932b | 2009-10-27 16:11:26 +0100 | [diff] [blame] | 62 | _GOT2_TABLE_ = .; |
Wolfgang Denk | fe33e6e | 2010-11-21 20:55:42 +0100 | [diff] [blame] | 63 | KEEP(*(.got2)) |
Joakim Tjernlund | 42126a6 | 2010-12-03 17:30:37 +0100 | [diff] [blame] | 64 | KEEP(*(.got)) |
| 65 | PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4); |
Stefan Roese | 90c932b | 2009-10-27 16:11:26 +0100 | [diff] [blame] | 66 | _FIXUP_TABLE_ = .; |
Wolfgang Denk | fe33e6e | 2010-11-21 20:55:42 +0100 | [diff] [blame] | 67 | KEEP(*(.fixup)) |
Stefan Roese | 90c932b | 2009-10-27 16:11:26 +0100 | [diff] [blame] | 68 | } |
Joakim Tjernlund | 42126a6 | 2010-12-03 17:30:37 +0100 | [diff] [blame] | 69 | __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1; |
Stefan Roese | 90c932b | 2009-10-27 16:11:26 +0100 | [diff] [blame] | 70 | __fixup_entries = (. - _FIXUP_TABLE_) >> 2; |
| 71 | |
| 72 | .data : |
| 73 | { |
Wolfgang Denk | fe33e6e | 2010-11-21 20:55:42 +0100 | [diff] [blame] | 74 | *(.data*) |
| 75 | *(.sdata*) |
Stefan Roese | 90c932b | 2009-10-27 16:11:26 +0100 | [diff] [blame] | 76 | } |
| 77 | _edata = .; |
| 78 | PROVIDE (edata = .); |
| 79 | |
| 80 | . = .; |
Stefan Roese | 90c932b | 2009-10-27 16:11:26 +0100 | [diff] [blame] | 81 | |
Marek Vasut | 607092a | 2012-10-12 10:27:03 +0000 | [diff] [blame] | 82 | . = ALIGN(4); |
| 83 | .u_boot_list : { |
Albert ARIBAUD | c24895e | 2013-02-25 00:59:00 +0000 | [diff] [blame] | 84 | KEEP(*(SORT(.u_boot_list*))); |
Marek Vasut | 607092a | 2012-10-12 10:27:03 +0000 | [diff] [blame] | 85 | } |
| 86 | |
Stefan Roese | 90c932b | 2009-10-27 16:11:26 +0100 | [diff] [blame] | 87 | . = .; |
| 88 | __start___ex_table = .; |
| 89 | __ex_table : { *(__ex_table) } |
| 90 | __stop___ex_table = .; |
| 91 | |
| 92 | . = ALIGN(256); |
| 93 | __init_begin = .; |
| 94 | .text.init : { *(.text.init) } |
| 95 | .data.init : { *(.data.init) } |
| 96 | . = ALIGN(256); |
| 97 | __init_end = .; |
| 98 | |
Stefan Roese | 07038ad | 2013-04-02 10:37:04 +0200 | [diff] [blame^] | 99 | #ifndef CONFIG_SPL |
Stefan Roese | 90c932b | 2009-10-27 16:11:26 +0100 | [diff] [blame] | 100 | #ifdef CONFIG_440 |
| 101 | .bootpg RESET_VECTOR_ADDRESS - 0xffc : |
| 102 | { |
Stefan Roese | 88fbf93 | 2010-04-15 16:07:28 +0200 | [diff] [blame] | 103 | arch/powerpc/cpu/ppc4xx/start.o (.bootpg) |
Stefan Roese | 90c932b | 2009-10-27 16:11:26 +0100 | [diff] [blame] | 104 | |
| 105 | /* |
| 106 | * PPC440 board need a board specific object with the |
| 107 | * TLB definitions. This needs to get included right after |
| 108 | * start.o, since the first shadow TLB only covers 4k |
| 109 | * of address space. |
| 110 | */ |
Ricardo Ribalda Delgado | b384381 | 2010-12-07 14:27:56 +0100 | [diff] [blame] | 111 | #ifdef CONFIG_INIT_TLB |
| 112 | CONFIG_INIT_TLB (.bootpg) |
| 113 | #else |
Stefan Roese | 90c932b | 2009-10-27 16:11:26 +0100 | [diff] [blame] | 114 | CONFIG_BOARDDIR/init.o (.bootpg) |
Ricardo Ribalda Delgado | b384381 | 2010-12-07 14:27:56 +0100 | [diff] [blame] | 115 | #endif |
Stefan Roese | 90c932b | 2009-10-27 16:11:26 +0100 | [diff] [blame] | 116 | } :text = 0xffff |
| 117 | #endif |
| 118 | |
| 119 | .resetvec RESET_VECTOR_ADDRESS : |
| 120 | { |
Wolfgang Denk | fe33e6e | 2010-11-21 20:55:42 +0100 | [diff] [blame] | 121 | KEEP(*(.resetvec)) |
Stefan Roese | 90c932b | 2009-10-27 16:11:26 +0100 | [diff] [blame] | 122 | } :text = 0xffff |
| 123 | |
| 124 | . = RESET_VECTOR_ADDRESS + 0x4; |
| 125 | |
| 126 | /* |
| 127 | * Make sure that the bss segment isn't linked at 0x0, otherwise its |
| 128 | * address won't be updated during relocation fixups. Note that |
| 129 | * this is a temporary fix. Code to dynamically the fixup the bss |
| 130 | * location will be added in the future. When the bss relocation |
| 131 | * fixup code is present this workaround should be removed. |
| 132 | */ |
| 133 | #if (RESET_VECTOR_ADDRESS == 0xfffffffc) |
| 134 | . |= 0x10; |
| 135 | #endif |
Stefan Roese | 07038ad | 2013-04-02 10:37:04 +0200 | [diff] [blame^] | 136 | #endif /* CONFIG_SPL */ |
Stefan Roese | 90c932b | 2009-10-27 16:11:26 +0100 | [diff] [blame] | 137 | |
| 138 | __bss_start = .; |
| 139 | .bss (NOLOAD) : |
| 140 | { |
Wolfgang Denk | fe33e6e | 2010-11-21 20:55:42 +0100 | [diff] [blame] | 141 | *(.bss*) |
| 142 | *(.sbss*) |
Stefan Roese | 90c932b | 2009-10-27 16:11:26 +0100 | [diff] [blame] | 143 | *(COMMON) |
| 144 | } :bss |
| 145 | |
| 146 | . = ALIGN(4); |
Simon Glass | ed70c8f | 2013-03-14 06:54:53 +0000 | [diff] [blame] | 147 | __bss_end = . ; |
Stefan Roese | 90c932b | 2009-10-27 16:11:26 +0100 | [diff] [blame] | 148 | PROVIDE (end = .); |
| 149 | } |