diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/ppc64/kernel/module.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/ppc64/kernel/module.c b/arch/ppc64/kernel/module.c index c683bf88e690..928b8581fcb0 100644 --- a/arch/ppc64/kernel/module.c +++ b/arch/ppc64/kernel/module.c | |||
@@ -341,6 +341,19 @@ int apply_relocate_add(Elf64_Shdr *sechdrs, | |||
341 | *(unsigned long *)location = my_r2(sechdrs, me); | 341 | *(unsigned long *)location = my_r2(sechdrs, me); |
342 | break; | 342 | break; |
343 | 343 | ||
344 | case R_PPC64_TOC16: | ||
345 | /* Subtact TOC pointer */ | ||
346 | value -= my_r2(sechdrs, me); | ||
347 | if (value + 0x8000 > 0xffff) { | ||
348 | printk("%s: bad TOC16 relocation (%lu)\n", | ||
349 | me->name, value); | ||
350 | return -ENOEXEC; | ||
351 | } | ||
352 | *((uint16_t *) location) | ||
353 | = (*((uint16_t *) location) & ~0xffff) | ||
354 | | (value & 0xffff); | ||
355 | break; | ||
356 | |||
344 | case R_PPC64_TOC16_DS: | 357 | case R_PPC64_TOC16_DS: |
345 | /* Subtact TOC pointer */ | 358 | /* Subtact TOC pointer */ |
346 | value -= my_r2(sechdrs, me); | 359 | value -= my_r2(sechdrs, me); |