blob: b34d2125f79051e71679aab7cdb96a319c67e0f4 [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
Kumar Gala7a577fd2011-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 Gala6c97a202009-09-09 11:40:41 -050012#define RESET_VECTOR_ADDRESS 0xfffffffc
13#endif
14
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -050015OUTPUT_ARCH(powerpc)
Alexander Graffd96ea42014-04-11 17:09:44 +020016ENTRY(_start_e500)
Peter Tyserfbe53f52010-09-29 14:05:56 -050017
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -050018PHDRS
19{
20 text PT_LOAD;
21 bss PT_LOAD;
22}
23
24SECTIONS
25{
26 /* Read-only sections, merged into text segment: */
27 . = + SIZEOF_HEADERS;
28 .interp : { *(.interp) }
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -050029 .text :
30 {
Peter Tyserfbe53f52010-09-29 14:05:56 -050031 *(.text*)
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -050032 } :text
33 _etext = .;
34 PROVIDE (etext = .);
35 .rodata :
36 {
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -050037 *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
38 } :text
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -050039
40 /* Read-write section, merged into data segment: */
41 . = (. + 0x00FF) & 0xFFFFFF00;
42 _erotext = .;
43 PROVIDE (erotext = .);
44 .reloc :
45 {
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -050046 _GOT2_TABLE_ = .;
Peter Tyserfbe53f52010-09-29 14:05:56 -050047 KEEP(*(.got2))
Joakim Tjernlund337f5f52010-12-03 17:30:37 +010048 KEEP(*(.got))
49 PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -050050 _FIXUP_TABLE_ = .;
Peter Tyserfbe53f52010-09-29 14:05:56 -050051 KEEP(*(.fixup))
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -050052 }
Joakim Tjernlund337f5f52010-12-03 17:30:37 +010053 __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -050054 __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
55
56 .data :
57 {
Peter Tyserfbe53f52010-09-29 14:05:56 -050058 *(.data*)
59 *(.sdata*)
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -050060 }
61 _edata = .;
62 PROVIDE (edata = .);
63
64 . = .;
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -050065
Marek Vasut55675142012-10-12 10:27:03 +000066 . = ALIGN(4);
67 .u_boot_list : {
Albert ARIBAUDef123c52013-02-25 00:59:00 +000068 KEEP(*(SORT(.u_boot_list*)));
Marek Vasut55675142012-10-12 10:27:03 +000069 }
70
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -050071 . = .;
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 Zhang5df572f2013-05-20 14:07:23 +080083#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 Gala6c97a202009-09-09 11:40:41 -050090 .bootpg RESET_VECTOR_ADDRESS - 0xffc :
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -050091 {
Stefan Roesea47a12b2010-04-15 16:07:28 +020092 arch/powerpc/cpu/mpc85xx/start.o (.bootpg)
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -050093 } :text = 0xffff
94
Kumar Gala6c97a202009-09-09 11:40:41 -050095 .resetvec RESET_VECTOR_ADDRESS :
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -050096 {
Peter Tyserfbe53f52010-09-29 14:05:56 -050097 KEEP(*(.resetvec))
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -050098 } :text = 0xffff
99
Kumar Gala6c97a202009-09-09 11:40:41 -0500100 . = RESET_VECTOR_ADDRESS + 0x4;
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500101
Peter Tyser3beb40c2009-10-07 11:45:00 -0500102 /*
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 Zhang5df572f2013-05-20 14:07:23 +0800112#endif
Peter Tyser3beb40c2009-10-07 11:45:00 -0500113
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500114 __bss_start = .;
115 .bss (NOLOAD) :
116 {
Peter Tyserfbe53f52010-09-29 14:05:56 -0500117 *(.sbss*)
118 *(.bss*)
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500119 *(COMMON)
120 } :bss
121
122 . = ALIGN(4);
Simon Glass3929fb02013-03-14 06:54:53 +0000123 __bss_end = . ;
Srikanth Srinivasanfeb78382009-04-03 15:36:13 -0500124 PROVIDE (end = .);
125}