From: Simon Vallet Date: Wed, 3 Jan 2007 06:49:56 +0000 (+0100) Subject: [POWERPC] Add support for R_PPC_ADDR16_HI relocations X-Git-Tag: v2.6.21-rc2~42^2~3^2~103 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=9a3d6458e9dded0a060115b446531cfc77083ebb;p=linux-2.6-omap-h63xx.git [POWERPC] Add support for R_PPC_ADDR16_HI relocations apply_relocate_add() does not support R_PPC_ADDR16_HI relocations, which prevents some non gcc-built modules to be loaded. Signed-off-by: Simon Vallet Signed-off-by: Paul Mackerras --- diff --git a/arch/powerpc/kernel/module_32.c b/arch/powerpc/kernel/module_32.c index 8339fd609de..07a89a39863 100644 --- a/arch/powerpc/kernel/module_32.c +++ b/arch/powerpc/kernel/module_32.c @@ -224,7 +224,12 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, /* Low half of the symbol */ *(uint16_t *)location = value; break; - + + case R_PPC_ADDR16_HI: + /* Higher half of the symbol */ + *(uint16_t *)location = (value >> 16); + break; + case R_PPC_ADDR16_HA: /* Sign-adjusted lower 16 bits: PPC ELF ABI says: (((x >> 16) + ((x & 0x8000) ? 1 : 0))) & 0xFFFF.