* elf32-ppc.c (ppc_elf_relocate_section): Correct GOT and PLT HA

reloc handling.
	* elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
This commit is contained in:
Alan Modra 2006-08-22 12:06:10 +00:00
parent 57da97f58c
commit 5c5f6e17d0
3 changed files with 33 additions and 21 deletions

View file

@ -1,3 +1,9 @@
2006-08-22 Alan Modra <amodra@bigpond.net.au>
* elf32-ppc.c (ppc_elf_relocate_section): Correct GOT and PLT HA
reloc handling.
* elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
2006-08-21 Mark Shinwell <shinwell@codesourcery.com>
* elf32-arm.c (elf32_arm_link_hash_table): Correct typo in

View file

@ -6609,25 +6609,28 @@ ppc_elf_relocate_section (bfd *output_bfd,
case R_PPC_ADDR16_HA:
case R_PPC_REL16_HA:
case R_PPC_GOT16_HA:
case R_PPC_PLT16_HA:
case R_PPC_SECTOFF_HA:
case R_PPC_TPREL16_HA:
case R_PPC_DTPREL16_HA:
case R_PPC_GOT_TLSGD16_HA:
case R_PPC_GOT_TLSLD16_HA:
case R_PPC_GOT_TPREL16_HA:
case R_PPC_GOT_DTPREL16_HA:
case R_PPC_EMB_NADDR16_HA:
case R_PPC_EMB_RELST_HA:
/* It's just possible that this symbol is a weak symbol
that's not actually defined anywhere. In that case,
'sec' would be NULL, and we should leave the symbol
alone (it will be set to zero elsewhere in the link). */
if (sec != NULL)
/* Add 0x10000 if sign bit in 0:15 is set.
Bits 0:15 are not used. */
addend += 0x8000;
if (sec == NULL)
break;
/* Fall thru */
case R_PPC_PLT16_HA:
case R_PPC_GOT16_HA:
case R_PPC_GOT_TLSGD16_HA:
case R_PPC_GOT_TLSLD16_HA:
case R_PPC_GOT_TPREL16_HA:
case R_PPC_GOT_DTPREL16_HA:
/* Add 0x10000 if sign bit in 0:15 is set.
Bits 0:15 are not used. */
addend += 0x8000;
break;
}

View file

@ -10928,17 +10928,10 @@ ppc64_elf_relocate_section (bfd *output_bfd,
case R_PPC64_ADDR16_HA:
case R_PPC64_ADDR16_HIGHERA:
case R_PPC64_ADDR16_HIGHESTA:
case R_PPC64_GOT16_HA:
case R_PPC64_PLTGOT16_HA:
case R_PPC64_PLT16_HA:
case R_PPC64_TOC16_HA:
case R_PPC64_SECTOFF_HA:
case R_PPC64_TPREL16_HA:
case R_PPC64_DTPREL16_HA:
case R_PPC64_GOT_TLSGD16_HA:
case R_PPC64_GOT_TLSLD16_HA:
case R_PPC64_GOT_TPREL16_HA:
case R_PPC64_GOT_DTPREL16_HA:
case R_PPC64_TPREL16_HIGHER:
case R_PPC64_TPREL16_HIGHERA:
case R_PPC64_TPREL16_HIGHEST:
@ -10951,10 +10944,20 @@ ppc64_elf_relocate_section (bfd *output_bfd,
that's not actually defined anywhere. In that case,
'sec' would be NULL, and we should leave the symbol
alone (it will be set to zero elsewhere in the link). */
if (sec != NULL)
/* Add 0x10000 if sign bit in 0:15 is set.
Bits 0:15 are not used. */
addend += 0x8000;
if (sec == NULL)
break;
/* Fall thru */
case R_PPC64_GOT16_HA:
case R_PPC64_PLTGOT16_HA:
case R_PPC64_PLT16_HA:
case R_PPC64_GOT_TLSGD16_HA:
case R_PPC64_GOT_TLSLD16_HA:
case R_PPC64_GOT_TPREL16_HA:
case R_PPC64_GOT_DTPREL16_HA:
/* Add 0x10000 if sign bit in 0:15 is set.
Bits 0:15 are not used. */
addend += 0x8000;
break;
case R_PPC64_ADDR16_DS: