Merge branch 'master' of git://git.denx.de/u-boot-sh
[oweals/u-boot.git] / arch / mips / cpu / u-boot.lds
index fc943af92350ee80e11dbd0158a4b66f5c2cfcb8..fd0f1b5d4f444a2b75f701d63ee2bbf5c47fd68e 100644 (file)
@@ -1,8 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * (C) Copyright 2003
  * Wolfgang Denk Engineering, <wd@denx.de>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 OUTPUT_ARCH(mips)
@@ -42,16 +41,22 @@ SECTIONS
        __image_copy_end = .;
        __init_end = .;
 
-       /*
-        * .rel must come last so that the mips-relocs tool can shrink
-        * the section size & the PT_LOAD program header filesz.
-        */
-       .rel : {
+       .data.reloc : {
                __rel_start = .;
-               BYTE(0x0)
-               . += (32 * 1024) - 1;
+               /*
+                * Space for relocation table
+                * This needs to be filled so that the
+                * mips-reloc tool can overwrite the content.
+                * An invalid value is left at the start of the
+                * section to abort relocation if the table
+                * has not been filled in.
+                */
+               LONG(0xFFFFFFFF);
+               FILL(0);
+               . += CONFIG_MIPS_RELOCATION_TABLE_SIZE - 4;
        }
 
+       . = ALIGN(4);
        _end = .;
 
        .bss __rel_start (OVERLAY) : {