aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorPeter Bergner <bergner@vnet.ibm.com>2005-10-11 09:28:24 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-11 09:46:54 -0700
commit9149ccfa3571eaa4a4b444777d67fc4ed3ebcf27 (patch)
tree92d07c8a2e76abf5b5805db6deb5a90d69406b76 /arch
parentd3089792f6ee38cdc9e254a7cb2f8c8d7f38c20d (diff)
[PATCH] ppc64: Add R_PPC64_TOC16 module reloc
Newer gcc's are generating this relocation, so the module loader needs to handle it. Signed-off-by: Peter Bergner <bergner@vnet.ibm.com> Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/ppc64/kernel/module.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/ppc64/kernel/module.c b/arch/ppc64/kernel/module.c
index c683bf88e69..928b8581fcb 100644
--- a/arch/ppc64/kernel/module.c
+++ b/arch/ppc64/kernel/module.c
@@ -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);