aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-ppc.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2006-08-22 12:06:10 +0000
committerAlan Modra <amodra@gmail.com>2006-08-22 12:06:10 +0000
commit5c5f6e17d0445d1c67dd8a0a8310231b717e776c (patch)
treea18ffa0eaf598f7a54e97bbdf51922afad2d1b0e /bfd/elf32-ppc.c
parent57da97f58cd03bfd891f5f904876c65cb1f37e4b (diff)
downloadgdb-5c5f6e17d0445d1c67dd8a0a8310231b717e776c.zip
gdb-5c5f6e17d0445d1c67dd8a0a8310231b717e776c.tar.gz
gdb-5c5f6e17d0445d1c67dd8a0a8310231b717e776c.tar.bz2
* elf32-ppc.c (ppc_elf_relocate_section): Correct GOT and PLT HA
reloc handling. * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
Diffstat (limited to 'bfd/elf32-ppc.c')
-rw-r--r--bfd/elf32-ppc.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index bc449b3..6e80a1e 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -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;
}