From c70f74a081c2005b0a4749cf8762fc14b7369ddb Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 7 Nov 2016 08:47:09 -0700 Subject: elf: arm: Add a few ARM relocation types Rather than hard-coding the relocation type, add it to the ELF header file and use it from there. Signed-off-by: Simon Glass Signed-off-by: Alexander Graf --- arch/arm/lib/relocate.S | 3 ++- arch/arm/lib/relocate_64.S | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'arch/arm/lib') diff --git a/arch/arm/lib/relocate.S b/arch/arm/lib/relocate.S index 475d503dd9d..a6fb07c401d 100644 --- a/arch/arm/lib/relocate.S +++ b/arch/arm/lib/relocate.S @@ -8,6 +8,7 @@ #include #include +#include #include #ifdef CONFIG_CPU_V7M #include @@ -96,7 +97,7 @@ copy_loop: fixloop: ldmia r2!, {r0-r1} /* (r0,r1) <- (SRC location,fixup) */ and r1, r1, #0xff - cmp r1, #23 /* relative fixup? */ + cmp r1, #R_ARM_RELATIVE bne fixnext /* relative fix: increase location by offset */ diff --git a/arch/arm/lib/relocate_64.S b/arch/arm/lib/relocate_64.S index 5c51cae8ab0..242e56e9608 100644 --- a/arch/arm/lib/relocate_64.S +++ b/arch/arm/lib/relocate_64.S @@ -10,6 +10,7 @@ #include #include +#include #include #include @@ -47,7 +48,7 @@ fixloop: ldp x0, x1, [x2], #16 /* (x0,x1) <- (SRC location, fixup) */ ldr x4, [x2], #8 /* x4 <- addend */ and x1, x1, #0xffffffff - cmp x1, #1027 /* relative fixup? */ + cmp x1, #R_AARCH64_RELATIVE bne fixnext /* relative fix: store addend plus offset at dest location */ -- cgit v1.2.3