blob: f15eaf38052caece83515d468cb2d6eed68eca2d [file] [log] [blame]
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -05001/*
Kumar Gala7a577fd2011-01-12 02:48:53 -06002 * Copyright 2007-2009, 2011 Freescale Semiconductor, Inc.
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -05003 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02004 * SPDX-License-Identifier: GPL-2.0+
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -05005 */
6
Masahiro Yamada6f2ed0e2014-04-28 10:17:10 +09007#include "config.h"
Kumar Gala7a577fd2011-01-12 02:48:53 -06008
9#ifdef CONFIG_RESET_VECTOR_ADDRESS
10#define RESET_VECTOR_ADDRESS CONFIG_RESET_VECTOR_ADDRESS
11#else
Kumar Gala6c97a202009-09-09 11:40:41 -050012#define RESET_VECTOR_ADDRESS 0xfffffffc
13#endif
14
Prabhakar Kushwaha0938b602014-03-31 15:31:34 +053015#ifndef CONFIG_SYS_MONITOR_LEN
16#define CONFIG_SYS_MONITOR_LEN 0x80000
17#endif
18
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -050019OUTPUT_ARCH(powerpc)
Alexander Graffd96ea42014-04-11 17:09:44 +020020ENTRY(_start_e500)
Peter Tyserfbe53f52010-09-29 14:05:56 -050021
Srikanth Srinivasanfeb78382009-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 Srinivasanfeb78382009-04-03 15:36:13 -050033 .text :
34 {
Peter Tyserfbe53f52010-09-29 14:05:56 -050035 *(.text*)
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -050036 } :text
37 _etext = .;
38 PROVIDE (etext = .);
39 .rodata :
40 {
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -050041 *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
42 } :text
Srikanth Srinivasanfeb78382009-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 Srinivasanfeb78382009-04-03 15:36:13 -050050 _GOT2_TABLE_ = .;
Peter Tyserfbe53f52010-09-29 14:05:56 -050051 KEEP(*(.got2))
Joakim Tjernlund337f5f52010-12-03 17:30:37 +010052 KEEP(*(.got))
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -050053 _FIXUP_TABLE_ = .;
Peter Tyserfbe53f52010-09-29 14:05:56 -050054 KEEP(*(.fixup))
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -050055 }
Joakim Tjernlund337f5f52010-12-03 17:30:37 +010056 __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -050057 __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
58
59 .data :
60 {
Peter Tyserfbe53f52010-09-29 14:05:56 -050061 *(.data*)
62 *(.sdata*)
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -050063 }
64 _edata = .;
65 PROVIDE (edata = .);
66
67 . = .;
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -050068
Marek Vasut55675142012-10-12 10:27:03 +000069 . = ALIGN(4);
70 .u_boot_list : {
Albert ARIBAUDef123c52013-02-25 00:59:00 +000071 KEEP(*(SORT(.u_boot_list*)));
Marek Vasut55675142012-10-12 10:27:03 +000072 }
73
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -050074 . = .;
75 __start___ex_table = .;
76 __ex_table : { *(__ex_table) }
77 __stop___ex_table = .;
78
79 . = ALIGN(256);
80 __init_begin = .;
81 .text.init : { *(.text.init) }
82 .data.init : { *(.data.init) }
83 . = ALIGN(256);
84 __init_end = .;
85
Ying Zhang5df572f2013-05-20 14:07:23 +080086#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 Kushwaha0938b602014-03-31 15:31:34 +053091 . = ADDR(.text) + CONFIG_SYS_MONITOR_LEN;
Ying Zhang5df572f2013-05-20 14:07:23 +080092#else
Kumar Gala6c97a202009-09-09 11:40:41 -050093 .bootpg RESET_VECTOR_ADDRESS - 0xffc :
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -050094 {
Stefan Roesea47a12b2010-04-15 16:07:28 +020095 arch/powerpc/cpu/mpc85xx/start.o (.bootpg)
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -050096 } :text = 0xffff
97
Kumar Gala6c97a202009-09-09 11:40:41 -050098 .resetvec RESET_VECTOR_ADDRESS :
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -050099 {
Peter Tyserfbe53f52010-09-29 14:05:56 -0500100 KEEP(*(.resetvec))
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500101 } :text = 0xffff
102
Kumar Gala6c97a202009-09-09 11:40:41 -0500103 . = RESET_VECTOR_ADDRESS + 0x4;
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500104
Peter Tyser3beb40c2009-10-07 11:45:00 -0500105 /*
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 Zhang5df572f2013-05-20 14:07:23 +0800115#endif
Peter Tyser3beb40c2009-10-07 11:45:00 -0500116
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500117 __bss_start = .;
118 .bss (NOLOAD) :
119 {
Peter Tyserfbe53f52010-09-29 14:05:56 -0500120 *(.sbss*)
121 *(.bss*)
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500122 *(COMMON)
123 } :bss
124
125 . = ALIGN(4);
Simon Glass3929fb02013-03-14 06:54:53 +0000126 __bss_end = . ;
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500127 PROVIDE (end = .);
128}