]> err.no Git - linux-2.6/commitdiff
[POWERPC] Add support for R_PPC_ADDR16_HI relocations
authorSimon Vallet <linux-ppc@castalie.org>
Wed, 3 Jan 2007 06:49:56 +0000 (07:49 +0100)
committerPaul Mackerras <paulus@samba.org>
Wed, 24 Jan 2007 10:13:58 +0000 (21:13 +1100)
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>
arch/powerpc/kernel/module_32.c

index 8339fd609de045c6c92777594009f9492391163d..07a89a3986394ebfd5eafabaaeb468358445beff 100644 (file)
@@ -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.