summaryrefslogtreecommitdiff
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
commit23523fa6b5f19612d1c4e6b86292a68629ca43a8 (patch)
tree1aafe89edc0b11db0a319438f83e8e49f852b81d
parentf6a56f7126799388820c0fdef0cbae1743fb9da1 (diff)
downloadgdb-23523fa6b5f19612d1c4e6b86292a68629ca43a8.tar.gz
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.
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elf32-ppc.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 5b8d9086210..794f18f1226 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2006-03-17 Alexandre Oliva <aoliva@redhat.com>
+
+ * 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.
+
2006-03-17 Alan Modra <amodra@bigpond.net.au>
PR 2434
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index 2fd30a0560b..6a2d5170d78 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);