Skip to content

Commit

Permalink
sparc32: Enable the relocation target R_SPARC_DISP32 for sparc32
Browse files Browse the repository at this point in the history
GNU Binutils 2.20.1 generates .eh_frame sections that uses R_SPARC_DISP32.

Signed-off-by: Andreas Larsson <andreas@gaisler.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Andreas Larsson authored and David S. Miller committed Sep 21, 2012
1 parent c46de22 commit dfa520a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions arch/sparc/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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) |
Expand Down

0 comments on commit dfa520a

Please sign in to comment.