Skip to content

Commit

Permalink
[POWERPC] Add support for R_PPC_ADDR16_HI relocations
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Simon Vallet authored and Paul Mackerras committed Jan 24, 2007
1 parent 06c3147 commit 9a3d645
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion arch/powerpc/kernel/module_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 9a3d645

Please sign in to comment.