blob: 0b9086dfd09befe23d47bb76e424e34ac9463d9d [file] [log] [blame]
Srikanth Srinivasan949a2d52009-04-03 15:36:13 -05001/*
Kumar Galae727a362011-01-12 02:48:53 -06002 * Copyright 2007-2009, 2011 Freescale Semiconductor, Inc.
Srikanth Srinivasan949a2d52009-04-03 15:36:13 -05003 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02004 * SPDX-License-Identifier: GPL-2.0+
Srikanth Srinivasan949a2d52009-04-03 15:36:13 -05005 */
6
Kumar Galae727a362011-01-12 02:48:53 -06007#include "config.h" /* CONFIG_BOARDDIR */
8
9#ifdef CONFIG_RESET_VECTOR_ADDRESS
10#define RESET_VECTOR_ADDRESS CONFIG_RESET_VECTOR_ADDRESS
11#else
Kumar Gala6472af82009-09-09 11:40:41 -050012#define RESET_VECTOR_ADDRESS 0xfffffffc
13#endif
14
Prabhakar Kushwaha120a1c32014-03-31 15:31:34 +053015#ifndef CONFIG_SYS_MONITOR_LEN
16#define CONFIG_SYS_MONITOR_LEN 0x80000
17#endif
18
Srikanth Srinivasan949a2d52009-04-03 15:36:13 -050019OUTPUT_ARCH(powerpc)
Alexander Grafcc369a42014-04-11 17:09:44 +020020ENTRY(_start_e500)
Peter Tyser1047c162010-09-29 14:05:56 -050021
Srikanth Srinivasan949a2d52009-04-03 15:36:13 -050022PHDRS
23{
24 text PT_LOAD;
25 bss PT_LOAD;
26}
27
28SECTIONS
29{
30 /* Read-only sections, merged into text segment: */
31 . = + SIZEOF_HEADERS;
32 .interp : { *(.interp) }
Srikanth Srinivasan949a2d52009-04-03 15:36:13 -050033 .text :
34 {
Peter Tyser1047c162010-09-29 14:05:56 -050035 *(.text*)
Srikanth Srinivasan949a2d52009-04-03 15:36:13 -050036 } :text
37 _etext = .;
38 PROVIDE (etext = .);
39 .rodata :
40 {
Srikanth Srinivasan949a2d52009-04-03 15:36:13 -050041 *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
42 } :text
Srikanth Srinivasan949a2d52009-04-03 15:36:13 -050043
44 /* Read-write section, merged into data segment: */
45 . = (. + 0x00FF) & 0xFFFFFF00;
46 _erotext = .;
47 PROVIDE (erotext = .);
48 .reloc :
49 {
Srikanth Srinivasan949a2d52009-04-03 15:36:13 -050050 _GOT2_TABLE_ = .;
Peter Tyser1047c162010-09-29 14:05:56 -050051 KEEP(*(.got2))
Joakim Tjernlund42126a62010-12-03 17:30:37 +010052 KEEP(*(.got))
53 PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
Srikanth Srinivasan949a2d52009-04-03 15:36:13 -050054 _FIXUP_TABLE_ = .;
Peter Tyser1047c162010-09-29 14:05:56 -050055 KEEP(*(.fixup))
Srikanth Srinivasan949a2d52009-04-03 15:36:13 -050056 }
Joakim Tjernlund42126a62010-12-03 17:30:37 +010057 __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
Srikanth Srinivasan949a2d52009-04-03 15:36:13 -050058 __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
59
60 .data :
61 {
Peter Tyser1047c162010-09-29 14:05:56 -050062 *(.data*)
63 *(.sdata*)
Srikanth Srinivasan949a2d52009-04-03 15:36:13 -050064 }
65 _edata = .;
66 PROVIDE (edata = .);
67
68 . = .;
Srikanth Srinivasan949a2d52009-04-03 15:36:13 -050069
Marek Vasut607092a2012-10-12 10:27:03 +000070 . = ALIGN(4);
71 .u_boot_list : {
Albert ARIBAUDc24895e2013-02-25 00:59:00 +000072 KEEP(*(SORT(.u_boot_list*)));
Marek Vasut607092a2012-10-12 10:27:03 +000073 }
74
Srikanth Srinivasan949a2d52009-04-03 15:36:13 -050075 . = .;
76 __start___ex_table = .;
77 __ex_table : { *(__ex_table) }
78 __stop___ex_table = .;
79
80 . = ALIGN(256);
81 __init_begin = .;
82 .text.init : { *(.text.init) }
83 .data.init : { *(.data.init) }
84 . = ALIGN(256);
85 __init_end = .;
86
Ying Zhang0d4f5442013-05-20 14:07:23 +080087#ifdef CONFIG_SYS_MPC85XX_NO_RESETVEC
88 .bootpg ADDR(.text) - 0x1000 :
89 {
90 KEEP(arch/powerpc/cpu/mpc85xx/start.o (.bootpg))
91 } :text = 0xffff
Prabhakar Kushwaha120a1c32014-03-31 15:31:34 +053092 . = ADDR(.text) + CONFIG_SYS_MONITOR_LEN;
Ying Zhang0d4f5442013-05-20 14:07:23 +080093#else
Kumar Gala6472af82009-09-09 11:40:41 -050094 .bootpg RESET_VECTOR_ADDRESS - 0xffc :
Srikanth Srinivasan949a2d52009-04-03 15:36:13 -050095 {
Stefan Roese88fbf932010-04-15 16:07:28 +020096 arch/powerpc/cpu/mpc85xx/start.o (.bootpg)
Srikanth Srinivasan949a2d52009-04-03 15:36:13 -050097 } :text = 0xffff
98
Kumar Gala6472af82009-09-09 11:40:41 -050099 .resetvec RESET_VECTOR_ADDRESS :
Srikanth Srinivasan949a2d52009-04-03 15:36:13 -0500100 {
Peter Tyser1047c162010-09-29 14:05:56 -0500101 KEEP(*(.resetvec))
Srikanth Srinivasan949a2d52009-04-03 15:36:13 -0500102 } :text = 0xffff
103
Kumar Gala6472af82009-09-09 11:40:41 -0500104 . = RESET_VECTOR_ADDRESS + 0x4;
Srikanth Srinivasan949a2d52009-04-03 15:36:13 -0500105
Peter Tyser430445f2009-10-07 11:45:00 -0500106 /*
107 * Make sure that the bss segment isn't linked at 0x0, otherwise its
108 * address won't be updated during relocation fixups. Note that
109 * this is a temporary fix. Code to dynamically the fixup the bss
110 * location will be added in the future. When the bss relocation
111 * fixup code is present this workaround should be removed.
112 */
113#if (RESET_VECTOR_ADDRESS == 0xfffffffc)
114 . |= 0x10;
115#endif
Ying Zhang0d4f5442013-05-20 14:07:23 +0800116#endif
Peter Tyser430445f2009-10-07 11:45:00 -0500117
Srikanth Srinivasan949a2d52009-04-03 15:36:13 -0500118 __bss_start = .;
119 .bss (NOLOAD) :
120 {
Peter Tyser1047c162010-09-29 14:05:56 -0500121 *(.sbss*)
122 *(.bss*)
Srikanth Srinivasan949a2d52009-04-03 15:36:13 -0500123 *(COMMON)
124 } :bss
125
126 . = ALIGN(4);
Simon Glassed70c8f2013-03-14 06:54:53 +0000127 __bss_end = . ;
Srikanth Srinivasan949a2d52009-04-03 15:36:13 -0500128 PROVIDE (end = .);
129}