Merge https://gitlab.denx.de/u-boot/custodians/u-boot-mmc
[platform/kernel/u-boot.git] / arch / powerpc / cpu / mpc85xx / u-boot.lds
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright 2007-2009, 2011 Freescale Semiconductor, Inc.
4  */
5
6 #include "config.h"
7
8 #ifdef CONFIG_RESET_VECTOR_ADDRESS
9 #define RESET_VECTOR_ADDRESS    CONFIG_RESET_VECTOR_ADDRESS
10 #else
11 #define RESET_VECTOR_ADDRESS    0xfffffffc
12 #endif
13
14 OUTPUT_ARCH(powerpc)
15 ENTRY(_start)
16
17 SECTIONS
18 {
19   /* Read-only sections, merged into text segment: */
20   .text      :
21   {
22 #if CONFIG_IS_ENABLED(SYS_MPC85XX_NO_RESETVEC)
23     KEEP(arch/powerpc/cpu/mpc85xx/start.o (.bootpg))
24 #endif
25     *(.text*)
26   }
27     _etext = .;
28     PROVIDE (etext = .);
29     .rodata    :
30    {
31     *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
32   }
33
34   /* Read-write section, merged into data segment: */
35   . = (. + 0x00FF) & 0xFFFFFF00;
36   _erotext = .;
37   PROVIDE (erotext = .);
38   .reloc   :
39   {
40     _GOT2_TABLE_ = .;
41     KEEP(*(.got2))
42     KEEP(*(.got))
43     _FIXUP_TABLE_ = .;
44     KEEP(*(.fixup))
45   }
46   __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
47   __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
48
49   .data    :
50   {
51     *(.data*)
52     *(.sdata*)
53   }
54   _edata  =  .;
55   PROVIDE (edata = .);
56
57   . = .;
58
59   . = ALIGN(4);
60   __u_boot_list : {
61         KEEP(*(SORT(__u_boot_list*)));
62   }
63
64   . = .;
65   __start___ex_table = .;
66   __ex_table : { *(__ex_table) }
67   __stop___ex_table = .;
68
69   . = ALIGN(4);
70   __init_begin = .;
71   .text.init : { *(.text.init) }
72   .data.init : { *(.data.init) }
73   . = ALIGN(4);
74   __init_end = .;
75   _end = .;
76
77 #if !CONFIG_IS_ENABLED(SYS_MPC85XX_NO_RESETVEC)
78   .bootpg RESET_VECTOR_ADDRESS - 0xffc :
79   {
80     arch/powerpc/cpu/mpc85xx/start.o    (.bootpg)
81   } = 0xffff
82
83   .resetvec RESET_VECTOR_ADDRESS :
84   {
85     KEEP(*(.resetvec))
86   } = 0xffff
87
88   . = RESET_VECTOR_ADDRESS + 0x4;
89
90   /*
91    * Make sure that the bss segment isn't linked at 0x0, otherwise its
92    * address won't be updated during relocation fixups.  Note that
93    * this is a temporary fix.  Code to dynamically the fixup the bss
94    * location will be added in the future.  When the bss relocation
95    * fixup code is present this workaround should be removed.
96    */
97 #if (RESET_VECTOR_ADDRESS == 0xfffffffc)
98   . |= 0x10;
99 #endif
100 #endif
101
102   __bss_start = .;
103   .bss (NOLOAD)       :
104   {
105    *(.sbss*)
106    *(.bss*)
107    *(COMMON)
108   }
109
110   . = ALIGN(4);
111   __bss_end = . ;
112   PROVIDE (end = .);
113 }