summaryrefslogtreecommitdiffstats
path: root/arch/arm/cpu
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2019-08-22 12:20:50 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2019-08-23 09:56:50 +0200
commitfab26e665163723dab2b44c57644580f95a80500 (patch)
tree3122c114ff12e3163693acb4690246697d3fd314 /arch/arm/cpu
parent7536df20a8aefb35b83aebdb5eac636ef1df75fd (diff)
downloadbarebox-fab26e665163723dab2b44c57644580f95a80500.tar.gz
barebox-fab26e665163723dab2b44c57644580f95a80500.tar.xz
ARM: aarch64: Fixup relocation table for the second relocation
In case we want to relocate the binary multiple times we have to adjust the relocation table itself for any further relocations. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Diffstat (limited to 'arch/arm/cpu')
-rw-r--r--arch/arm/cpu/common.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/arm/cpu/common.c b/arch/arm/cpu/common.c
index 4d957da1dc..c81b2b3791 100644
--- a/arch/arm/cpu/common.c
+++ b/arch/arm/cpu/common.c
@@ -84,6 +84,8 @@ void relocate_to_current_adr(void)
unsigned long *fixup = (unsigned long *)(rel->r_offset + offset);
*fixup = rel->r_addend + offset;
+ rel->r_addend += offset;
+ rel->r_offset += offset;
} else {
putc_ll('>');
puthex_ll(rel->r_info);