diff mbox

[v2] sparc32: Enable the relocation target R_SPARC_DISP32 for sparc32

Message ID 1347947992-30526-1-git-send-email-andreas@gaisler.com
State Accepted
Delegated to: David Miller
Headers show

Commit Message

Andreas Larsson Sept. 18, 2012, 5:59 a.m. UTC
GNU Binutils 2.20.1 generates .eh_frame sections that uses R_SPARC_DISP32.

Signed-off-by: Andreas Larsson <andreas@gaisler.com>
---
 arch/sparc/kernel/module.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

Comments

David Miller Sept. 21, 2012, 7:16 p.m. UTC | #1
From: Andreas Larsson <andreas@gaisler.com>
Date: Tue, 18 Sep 2012 07:59:52 +0200

> GNU Binutils 2.20.1 generates .eh_frame sections that uses R_SPARC_DISP32.
> 
> Signed-off-by: Andreas Larsson <andreas@gaisler.com>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/sparc/kernel/module.c b/arch/sparc/kernel/module.c
index 15e0a16..bae6ab6 100644
--- a/arch/sparc/kernel/module.c
+++ b/arch/sparc/kernel/module.c
@@ -116,6 +116,10 @@  int apply_relocate_add(Elf_Shdr *sechdrs,
 		v = sym->st_value + rel[i].r_addend;
 
 		switch (ELF_R_TYPE(rel[i].r_info) & 0xff) {
+		case R_SPARC_DISP32:
+			v -= (Elf_Addr) location;
+			*loc32 = v;
+			break;
 #ifdef CONFIG_SPARC64
 		case R_SPARC_64:
 			location[0] = v >> 56;
@@ -128,11 +132,6 @@  int apply_relocate_add(Elf_Shdr *sechdrs,
 			location[7] = v >>  0;
 			break;
 
-		case R_SPARC_DISP32:
-			v -= (Elf_Addr) location;
-			*loc32 = v;
-			break;
-
 		case R_SPARC_WDISP19:
 			v -= (Elf_Addr) location;
 			*loc32 = (*loc32 & ~0x7ffff) |