Commit 9a3d6458 authored by Simon Vallet's avatar Simon Vallet Committed by Paul Mackerras

[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: default avatarSimon Vallet <svallet@gmail.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 06c31475
...@@ -225,6 +225,11 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, ...@@ -225,6 +225,11 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
*(uint16_t *)location = value; *(uint16_t *)location = value;
break; break;
case R_PPC_ADDR16_HI:
/* Higher half of the symbol */
*(uint16_t *)location = (value >> 16);
break;
case R_PPC_ADDR16_HA: case R_PPC_ADDR16_HA:
/* Sign-adjusted lower 16 bits: PPC ELF ABI says: /* Sign-adjusted lower 16 bits: PPC ELF ABI says:
(((x >> 16) + ((x & 0x8000) ? 1 : 0))) & 0xFFFF. (((x >> 16) + ((x & 0x8000) ? 1 : 0))) & 0xFFFF.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment