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