R_ARM_REL32 relocation patch

Nitin Garg <[email protected]>
Newsgroups gmane.linux.ports.arm.general
Message-ID <[email protected]>
Hi All,

Pls review the attached patch for R_ARM_REL32 relocation handling.
Binutils 2.19.1 is adding the eh frame and hence we need to handle
R_ARM_REL32 for Loadable kernel modules.

Thanks,
Nitin

-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php
arm_rel32.patch (application/octet-stream, 800 B)
--- a/arch/arm/kernel/module.c	2009-07-20 16:57:49.000000000 -0500
+++ b/arch/arm/kernel/module.c	2009-07-28 14:13:06.000000000 -0500
@@ -132,6 +132,11 @@ apply_relocate(Elf32_Shdr *sechdrs, cons
 			*(u32 *)loc += sym->st_value;
 			break;
 
+		case R_ARM_REL32:
+			offset = *(u32 *)loc + sym->st_value - loc;
+			*(u32 *)loc = offset & 0xffffffff;
+			break;
+
 		case R_ARM_PC24:
 		case R_ARM_CALL:
 		case R_ARM_JUMP24:
--- a/arch/arm/include/asm/elf.h	2009-07-20 16:57:49.000000000 -0500
+++ b/arch/arm/include/asm/elf.h	2009-07-28 10:45:41.000000000 -0500
@@ -48,6 +48,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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.