From 963014641117291c15df2425caf46c7b4b979f18 Mon Sep 17 00:00:00 2001 From: Daniel Schwierzeck Date: Thu, 1 Nov 2018 02:02:21 +0100 Subject: MIPS: make size of relocation table fixed but configurable Currently the size of the relocation table will be shrunk to the actual size needed. Although this gives a maximal space saving, it messes up the _end symbol. This breaks features like appended DTBs because the _end symbol doesn't point to the real end of the U-Boot binary. Remove the size shrinking and make the size of the relocation table fixed but configurable. This follows the Linux approach and the user can adjust the size to his needs. Also rename the relocation table section from .rel to .data.reloc to follow the Linux approach and to avoid ambiguities with the .rel.* sections added by the linker. Reported-by: Lars Povlsen Signed-off-by: Daniel Schwierzeck --- arch/mips/cpu/u-boot.lds | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'arch/mips/cpu/u-boot.lds') diff --git a/arch/mips/cpu/u-boot.lds b/arch/mips/cpu/u-boot.lds index f2c9f94f74..fd0f1b5d4f 100644 --- a/arch/mips/cpu/u-boot.lds +++ b/arch/mips/cpu/u-boot.lds @@ -41,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) : { -- cgit