Srikanth Srinivasan | feb7838 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 1 | /* |
Kumar Gala | 7a577fd | 2011-01-12 02:48:53 -0600 | [diff] [blame] | 2 | * Copyright 2007-2009, 2011 Freescale Semiconductor, Inc. |
Srikanth Srinivasan | feb7838 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 3 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 4 | * SPDX-License-Identifier: GPL-2.0+ |
Srikanth Srinivasan | feb7838 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 5 | */ |
| 6 | |
Kumar Gala | 7a577fd | 2011-01-12 02:48:53 -0600 | [diff] [blame] | 7 | #include "config.h" /* CONFIG_BOARDDIR */ |
| 8 | |
| 9 | #ifdef CONFIG_RESET_VECTOR_ADDRESS |
| 10 | #define RESET_VECTOR_ADDRESS CONFIG_RESET_VECTOR_ADDRESS |
| 11 | #else |
Kumar Gala | 6c97a20 | 2009-09-09 11:40:41 -0500 | [diff] [blame] | 12 | #define RESET_VECTOR_ADDRESS 0xfffffffc |
| 13 | #endif |
| 14 | |
Srikanth Srinivasan | feb7838 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 15 | OUTPUT_ARCH(powerpc) |
Alexander Graf | fd96ea4 | 2014-04-11 17:09:44 +0200 | [diff] [blame] | 16 | ENTRY(_start_e500) |
Peter Tyser | fbe53f5 | 2010-09-29 14:05:56 -0500 | [diff] [blame] | 17 | |
Srikanth Srinivasan | feb7838 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 18 | PHDRS |
| 19 | { |
| 20 | text PT_LOAD; |
| 21 | bss PT_LOAD; |
| 22 | } |
| 23 | |
| 24 | SECTIONS |
| 25 | { |
| 26 | /* Read-only sections, merged into text segment: */ |
| 27 | . = + SIZEOF_HEADERS; |
| 28 | .interp : { *(.interp) } |
Srikanth Srinivasan | feb7838 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 29 | .text : |
| 30 | { |
Peter Tyser | fbe53f5 | 2010-09-29 14:05:56 -0500 | [diff] [blame] | 31 | *(.text*) |
Srikanth Srinivasan | feb7838 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 32 | } :text |
| 33 | _etext = .; |
| 34 | PROVIDE (etext = .); |
| 35 | .rodata : |
| 36 | { |
Srikanth Srinivasan | feb7838 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 37 | *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) |
| 38 | } :text |
Srikanth Srinivasan | feb7838 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 39 | |
| 40 | /* Read-write section, merged into data segment: */ |
| 41 | . = (. + 0x00FF) & 0xFFFFFF00; |
| 42 | _erotext = .; |
| 43 | PROVIDE (erotext = .); |
| 44 | .reloc : |
| 45 | { |
Srikanth Srinivasan | feb7838 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 46 | _GOT2_TABLE_ = .; |
Peter Tyser | fbe53f5 | 2010-09-29 14:05:56 -0500 | [diff] [blame] | 47 | KEEP(*(.got2)) |
Joakim Tjernlund | 337f5f5 | 2010-12-03 17:30:37 +0100 | [diff] [blame] | 48 | KEEP(*(.got)) |
| 49 | PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4); |
Srikanth Srinivasan | feb7838 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 50 | _FIXUP_TABLE_ = .; |
Peter Tyser | fbe53f5 | 2010-09-29 14:05:56 -0500 | [diff] [blame] | 51 | KEEP(*(.fixup)) |
Srikanth Srinivasan | feb7838 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 52 | } |
Joakim Tjernlund | 337f5f5 | 2010-12-03 17:30:37 +0100 | [diff] [blame] | 53 | __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1; |
Srikanth Srinivasan | feb7838 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 54 | __fixup_entries = (. - _FIXUP_TABLE_) >> 2; |
| 55 | |
| 56 | .data : |
| 57 | { |
Peter Tyser | fbe53f5 | 2010-09-29 14:05:56 -0500 | [diff] [blame] | 58 | *(.data*) |
| 59 | *(.sdata*) |
Srikanth Srinivasan | feb7838 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 60 | } |
| 61 | _edata = .; |
| 62 | PROVIDE (edata = .); |
| 63 | |
| 64 | . = .; |
Srikanth Srinivasan | feb7838 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 65 | |
Marek Vasut | 5567514 | 2012-10-12 10:27:03 +0000 | [diff] [blame] | 66 | . = ALIGN(4); |
| 67 | .u_boot_list : { |
Albert ARIBAUD | ef123c5 | 2013-02-25 00:59:00 +0000 | [diff] [blame] | 68 | KEEP(*(SORT(.u_boot_list*))); |
Marek Vasut | 5567514 | 2012-10-12 10:27:03 +0000 | [diff] [blame] | 69 | } |
| 70 | |
Srikanth Srinivasan | feb7838 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 71 | . = .; |
| 72 | __start___ex_table = .; |
| 73 | __ex_table : { *(__ex_table) } |
| 74 | __stop___ex_table = .; |
| 75 | |
| 76 | . = ALIGN(256); |
| 77 | __init_begin = .; |
| 78 | .text.init : { *(.text.init) } |
| 79 | .data.init : { *(.data.init) } |
| 80 | . = ALIGN(256); |
| 81 | __init_end = .; |
| 82 | |
Ying Zhang | 5df572f | 2013-05-20 14:07:23 +0800 | [diff] [blame] | 83 | #ifdef CONFIG_SYS_MPC85XX_NO_RESETVEC |
| 84 | .bootpg ADDR(.text) - 0x1000 : |
| 85 | { |
| 86 | KEEP(arch/powerpc/cpu/mpc85xx/start.o (.bootpg)) |
| 87 | } :text = 0xffff |
| 88 | . = ADDR(.text) + 0x80000; |
| 89 | #else |
Kumar Gala | 6c97a20 | 2009-09-09 11:40:41 -0500 | [diff] [blame] | 90 | .bootpg RESET_VECTOR_ADDRESS - 0xffc : |
Srikanth Srinivasan | feb7838 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 91 | { |
Stefan Roese | a47a12b | 2010-04-15 16:07:28 +0200 | [diff] [blame] | 92 | arch/powerpc/cpu/mpc85xx/start.o (.bootpg) |
Srikanth Srinivasan | feb7838 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 93 | } :text = 0xffff |
| 94 | |
Kumar Gala | 6c97a20 | 2009-09-09 11:40:41 -0500 | [diff] [blame] | 95 | .resetvec RESET_VECTOR_ADDRESS : |
Srikanth Srinivasan | feb7838 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 96 | { |
Peter Tyser | fbe53f5 | 2010-09-29 14:05:56 -0500 | [diff] [blame] | 97 | KEEP(*(.resetvec)) |
Srikanth Srinivasan | feb7838 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 98 | } :text = 0xffff |
| 99 | |
Kumar Gala | 6c97a20 | 2009-09-09 11:40:41 -0500 | [diff] [blame] | 100 | . = RESET_VECTOR_ADDRESS + 0x4; |
Srikanth Srinivasan | feb7838 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 101 | |
Peter Tyser | 3beb40c | 2009-10-07 11:45:00 -0500 | [diff] [blame] | 102 | /* |
| 103 | * Make sure that the bss segment isn't linked at 0x0, otherwise its |
| 104 | * address won't be updated during relocation fixups. Note that |
| 105 | * this is a temporary fix. Code to dynamically the fixup the bss |
| 106 | * location will be added in the future. When the bss relocation |
| 107 | * fixup code is present this workaround should be removed. |
| 108 | */ |
| 109 | #if (RESET_VECTOR_ADDRESS == 0xfffffffc) |
| 110 | . |= 0x10; |
| 111 | #endif |
Ying Zhang | 5df572f | 2013-05-20 14:07:23 +0800 | [diff] [blame] | 112 | #endif |
Peter Tyser | 3beb40c | 2009-10-07 11:45:00 -0500 | [diff] [blame] | 113 | |
Srikanth Srinivasan | feb7838 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 114 | __bss_start = .; |
| 115 | .bss (NOLOAD) : |
| 116 | { |
Peter Tyser | fbe53f5 | 2010-09-29 14:05:56 -0500 | [diff] [blame] | 117 | *(.sbss*) |
| 118 | *(.bss*) |
Srikanth Srinivasan | feb7838 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 119 | *(COMMON) |
| 120 | } :bss |
| 121 | |
| 122 | . = ALIGN(4); |
Simon Glass | 3929fb0 | 2013-03-14 06:54:53 +0000 | [diff] [blame] | 123 | __bss_end = . ; |
Srikanth Srinivasan | feb7838 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 124 | PROVIDE (end = .); |
| 125 | } |