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