aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-ppc.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2006-03-17 06:44:37 +0000
committerAlexandre Oliva <aoliva@redhat.com>2006-03-17 06:44:37 +0000
commite1710606c993baab0555429f130bbfd7a2fe3971 (patch)
treef3d338ef713b441c42b2d34ed092d765fbb0c4f1 /bfd/elf32-ppc.c
parent2de922512d6dede50c27e4af497e4b6fa5abb310 (diff)
downloadgdb-e1710606c993baab0555429f130bbfd7a2fe3971.zip
gdb-e1710606c993baab0555429f130bbfd7a2fe3971.tar.gz
gdb-e1710606c993baab0555429f130bbfd7a2fe3971.tar.bz2
bfd/ChangeLog:
* elf32-ppc.c (ppc_elf_relocate_section): Copy addend from first relocation to the second when relaxing TLS GD to LE; zero it out when relaxing to IE. ld/testsuite/ChangeLog: * ld-powerpc/tls32.s: Verify that +32768 @plt addend is discarded.
Diffstat (limited to 'bfd/elf32-ppc.c')
-rw-r--r--bfd/elf32-ppc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index 2fd30a0..6a2d517 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -5768,6 +5768,7 @@ ppc_elf_relocate_section (bfd *output_bfd,
insn1 |= 32 << 26; /* lwz */
insn2 = 0x7c631214; /* add 3,3,2 */
rel[1].r_info = ELF32_R_INFO (r_symndx2, R_PPC_NONE);
+ rel[1].r_addend = 0;
r_type = (((r_type - (R_PPC_GOT_TLSGD16 & 3)) & 3)
+ R_PPC_GOT_TPREL16);
rel->r_info = ELF32_R_INFO (r_symndx, r_type);
@@ -5782,13 +5783,13 @@ ppc_elf_relocate_section (bfd *output_bfd,
/* Was an LD reloc. */
r_symndx = 0;
rel->r_addend = htab->elf.tls_sec->vma + DTP_OFFSET;
- rel[1].r_addend = htab->elf.tls_sec->vma + DTP_OFFSET;
}
r_type = R_PPC_TPREL16_HA;
rel->r_info = ELF32_R_INFO (r_symndx, r_type);
rel[1].r_info = ELF32_R_INFO (r_symndx,
R_PPC_TPREL16_LO);
rel[1].r_offset += 2;
+ rel[1].r_addend = rel->r_addend;
}
bfd_put_32 (output_bfd, insn1, contents + rel->r_offset - 2);
bfd_put_32 (output_bfd, insn2, contents + offset);