aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/module_32.c
diff options
context:
space:
mode:
authorSimon Vallet <linux-ppc@castalie.org>2007-01-03 01:49:56 -0500
committerPaul Mackerras <paulus@samba.org>2007-01-24 05:13:58 -0500
commit9a3d6458e9dded0a060115b446531cfc77083ebb (patch)
tree83aa55c195f0226db783e1dc8e4dffd429fc638f /arch/powerpc/kernel/module_32.c
parent06c3147564cc65f0a5eac8af2b1834a996933e74 (diff)
[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 <svallet@gmail.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/module_32.c')
-rw-r--r--arch/powerpc/kernel/module_32.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/module_32.c b/arch/powerpc/kernel/module_32.c
index 8339fd609de0..07a89a398639 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,
224 /* Low half of the symbol */ 224 /* Low half of the symbol */
225 *(uint16_t *)location = value; 225 *(uint16_t *)location = value;
226 break; 226 break;
227 227
228 case R_PPC_ADDR16_HI:
229 /* Higher half of the symbol */
230 *(uint16_t *)location = (value >> 16);
231 break;
232
228 case R_PPC_ADDR16_HA: 233 case R_PPC_ADDR16_HA:
229 /* Sign-adjusted lower 16 bits: PPC ELF ABI says: 234 /* Sign-adjusted lower 16 bits: PPC ELF ABI says:
230 (((x >> 16) + ((x & 0x8000) ? 1 : 0))) & 0xFFFF. 235 (((x >> 16) + ((x & 0x8000) ? 1 : 0))) & 0xFFFF.