Skip to content

Commit

Permalink
[PATCH] ppc64: Add R_PPC64_TOC16 module reloc
Browse files Browse the repository at this point in the history
Newer gcc's are generating this relocation, so the module loader needs to
handle it.

Signed-off-by: Peter Bergner <[email protected]>
Signed-off-by: Anton Blanchard <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
peter-bergner authored and Linus Torvalds committed Oct 11, 2005
1 parent d308979 commit 9149ccf
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions arch/ppc64/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,19 @@ int apply_relocate_add(Elf64_Shdr *sechdrs,
*(unsigned long *)location = my_r2(sechdrs, me);
break;

case R_PPC64_TOC16:
/* Subtact TOC pointer */
value -= my_r2(sechdrs, me);
if (value + 0x8000 > 0xffff) {
printk("%s: bad TOC16 relocation (%lu)\n",
me->name, value);
return -ENOEXEC;
}
*((uint16_t *) location)
= (*((uint16_t *) location) & ~0xffff)
| (value & 0xffff);
break;

case R_PPC64_TOC16_DS:
/* Subtact TOC pointer */
value -= my_r2(sechdrs, me);
Expand Down

0 comments on commit 9149ccf

Please sign in to comment.