[PATCH] arm: R_ARM_REL32 relocation support

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Olof Johansson
Date: Thursday, August 5, 2010 - 12:36 am

commit d0679c730395d0bde9a46939e7ba255b4ba7dd7c moved -fno-dwarf2-cfi-asm to be
powerpc-only, causing R_ARM_REL32 to be used with some toolchains on ARM.

Implement support for it to make modules work with more toolchains.

Signed-off-by: Olof Johansson <olof@lixom.net>
---
 arch/arm/include/asm/elf.h |    1 +
 arch/arm/kernel/module.c   |    4 ++++
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/elf.h b/arch/arm/include/asm/elf.h
index 51662fe..b1f1991 100644
--- a/arch/arm/include/asm/elf.h
+++ b/arch/arm/include/asm/elf.h
@@ -50,6 +50,7 @@ typedef struct user_fp elf_fpregset_t;
 #define R_ARM_NONE		0
 #define R_ARM_PC24		1
 #define R_ARM_ABS32		2
+#define R_ARM_REL32		3
 #define R_ARM_CALL		28
 #define R_ARM_JUMP24		29
 #define R_ARM_V4BX		40
diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c
index c628bdf..ec9526d 100644
--- a/arch/arm/kernel/module.c
+++ b/arch/arm/kernel/module.c
@@ -132,6 +132,10 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex,
 			*(u32 *)loc += sym->st_value;
 			break;
 
+		case R_ARM_REL32:
+			*(u32 *)loc += sym->st_value - loc;
+			break;
+
 		case R_ARM_PC24:
 		case R_ARM_CALL:
 		case R_ARM_JUMP24:
-- 
1.5.6.5

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] arm: R_ARM_REL32 relocation support, Olof Johansson, (Thu Aug 5, 12:36 am)
Re: [PATCH] arm: R_ARM_REL32 relocation support, Mikael Pettersson, (Thu Aug 5, 1:48 am)
Re: [PATCH] arm: R_ARM_REL32 relocation support, Olof Johansson, (Thu Aug 5, 8:06 am)
Re: [PATCH] arm: R_ARM_REL32 relocation support, Martin Michlmayr, (Sat Aug 14, 4:44 am)
Re: [PATCH] arm: R_ARM_REL32 relocation support, Michal Marek, (Sat Aug 14, 3:46 pm)
Re: [PATCH] arm: R_ARM_REL32 relocation support, Michal Marek, (Sat Aug 14, 3:58 pm)