diff options
author | Milton Miller <miltonm@bga.com> | 2007-04-11 03:30:00 -0500 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2007-04-13 10:22:00 +0900 |
commit | c89a1770572654ef01ea9b12519c7f9fe05514f1 (patch) | |
tree | f449a83649f8aec628ce7d0d7fb4aa57cb5915c3 | |
parent | 1223d194299dbd43d583e094e71ebf5e79856e9e (diff) |
kexec-tools: ppc64: correct @ha relocation
The @ha relocation is supposed to account for the @l relocation being
a signed quantity by adding 1 if the msb of @l is set.
The trick of adding 0x8000 stolen from the linux kernel file
arch/powerpc/kernel/module_64.c which credits binutils.
Signed-off-by: Milton Miller <miltonm@bga.com>
Acked-by: Mohan Kumar M <mohan@in.ibm.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r-- | kexec/arch/ppc64/kexec-elf-rel-ppc64.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kexec/arch/ppc64/kexec-elf-rel-ppc64.c b/kexec/arch/ppc64/kexec-elf-rel-ppc64.c index a0d1750..c5fd561 100644 --- a/kexec/arch/ppc64/kexec-elf-rel-ppc64.c +++ b/kexec/arch/ppc64/kexec-elf-rel-ppc64.c @@ -97,7 +97,7 @@ void machine_apply_elf_rel(struct mem_ehdr *ehdr, unsigned long r_type, break; case R_PPC64_ADDR16_HA: - *(uint16_t *)location = ((value>>16) & 0xffff); + *(uint16_t *)location = (((value+0x8000)>>16) & 0xffff); break; case R_PPC64_ADDR16_HIGHEST: |