]> git.sur5r.net Git - u-boot/blobdiff - arch/arm/cpu/u-boot.lds
Merge branch 'next'
[u-boot] / arch / arm / cpu / u-boot.lds
index 9463a33dcb3dab4b99f558b5774a25787df9486f..13aa4fa48814f6da575e9ed53ff94be74d4a833d 100644 (file)
@@ -7,21 +7,70 @@
  * SPDX-License-Identifier:    GPL-2.0+
  */
 
+#include <config.h>
+
 OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
 OUTPUT_ARCH(arm)
 ENTRY(_start)
 SECTIONS
 {
+#if defined(CONFIG_ARMV7_SECURE_BASE) && defined(CONFIG_ARMV7_NONSEC)
+       /*
+        * If CONFIG_ARMV7_SECURE_BASE is true, secure code will not
+        * bundle with u-boot, and code offsets are fixed. Secure zone
+        * only needs to be copied from the loading address to
+        * CONFIG_ARMV7_SECURE_BASE, which is the linking and running
+        * address for secure code.
+        *
+        * If CONFIG_ARMV7_SECURE_BASE is undefined, the secure zone will
+        * be included in u-boot address space, and some absolute address
+        * were used in secure code. The absolute addresses of the secure
+        * code also needs to be relocated along with the accompanying u-boot
+        * code.
+        *
+        * So DISCARD is only for CONFIG_ARMV7_SECURE_BASE.
+        */
+       /DISCARD/ : { *(.rel._secure*) }
+#endif
        . = 0x00000000;
 
        . = ALIGN(4);
        .text :
        {
                *(.__image_copy_start)
+               *(.vectors)
                CPUDIR/start.o (.text*)
                *(.text*)
        }
 
+#ifdef CONFIG_ARMV7_NONSEC
+
+#ifndef CONFIG_ARMV7_SECURE_BASE
+#define CONFIG_ARMV7_SECURE_BASE
+#endif
+
+       .__secure_start : {
+               . = ALIGN(0x1000);
+               *(.__secure_start)
+       }
+
+       .secure_text CONFIG_ARMV7_SECURE_BASE :
+               AT(ADDR(.__secure_start) + SIZEOF(.__secure_start))
+       {
+               *(._secure.text)
+       }
+
+       . = LOADADDR(.__secure_start) +
+               SIZEOF(.__secure_start) +
+               SIZEOF(.secure_text);
+
+       __secure_end_lma = .;
+       .__secure_end : AT(__secure_end_lma) {
+               *(.__secure_end)
+               LONG(0x1d1071c);        /* Must output something to reset LMA */
+       }
+#endif
+
        . = ALIGN(4);
        .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
 
@@ -41,6 +90,36 @@ SECTIONS
 
        . = ALIGN(4);
 
+       .__efi_runtime_start : {
+               *(.__efi_runtime_start)
+       }
+
+       .efi_runtime : {
+               *(efi_runtime_text)
+               *(efi_runtime_data)
+       }
+
+       .__efi_runtime_stop : {
+               *(.__efi_runtime_stop)
+       }
+
+       .efi_runtime_rel_start :
+       {
+               *(.__efi_runtime_rel_start)
+       }
+
+       .efi_runtime_rel : {
+               *(.relefi_runtime_text)
+               *(.relefi_runtime_data)
+       }
+
+       .efi_runtime_rel_stop :
+       {
+               *(.__efi_runtime_rel_stop)
+       }
+
+       . = ALIGN(4);
+
        .image_copy_end :
        {
                *(.__image_copy_end)
@@ -60,7 +139,12 @@ SECTIONS
                *(.__rel_dyn_end)
        }
 
-       _end = .;
+       .end :
+       {
+               *(.__end)
+       }
+
+       _image_binary_end = .;
 
        /*
         * Deprecated: this MMU section is used by pxa at present but
@@ -91,14 +175,14 @@ SECTIONS
                KEEP(*(.__bss_end));
        }
 
-       .dynsym _end : { *(.dynsym) }
-       .hash : { *(.hash) }
-       .got.plt : { *(.got.plt) }
+       .dynsym _image_binary_end : { *(.dynsym) }
        .dynbss : { *(.dynbss) }
        .dynstr : { *(.dynstr*) }
        .dynamic : { *(.dynamic*) }
        .plt : { *(.plt*) }
        .interp : { *(.interp*) }
+       .gnu.hash : { *(.gnu.hash) }
        .gnu : { *(.gnu*) }
        .ARM.exidx : { *(.ARM.exidx*) }
+       .gnu.linkonce.armexidx : { *(.gnu.linkonce.armexidx.*) }
 }