aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-ppc.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2009-12-03 08:31:29 +0000
committerAlan Modra <amodra@gmail.com>2009-12-03 08:31:29 +0000
commitf58d5a2ddfb78a450f1bd6edc4c8d105b3ebc0f8 (patch)
treefcd534b53b8abade848e142c794735be88e85a67 /bfd/elf32-ppc.c
parent3aec4f9c2fe16765755d252ffe05aff9eb10bf8b (diff)
downloadgdb-f58d5a2ddfb78a450f1bd6edc4c8d105b3ebc0f8.zip
gdb-f58d5a2ddfb78a450f1bd6edc4c8d105b3ebc0f8.tar.gz
gdb-f58d5a2ddfb78a450f1bd6edc4c8d105b3ebc0f8.tar.bz2
PR ld/11047
* elf32-ppc.c (ppc_elf_relocate_section): Delete __tls_get_addr symbol reference from relocs belonging to calls that are optimized away. * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
Diffstat (limited to 'bfd/elf32-ppc.c')
-rw-r--r--bfd/elf32-ppc.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index e4fdc1e..976dd37 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -6929,9 +6929,7 @@ ppc_elf_relocate_section (bfd *output_bfd,
insn1 |= 32 << 26; /* lwz */
if (offset != (bfd_vma) -1)
{
- rel[1].r_info
- = ELF32_R_INFO (ELF32_R_SYM (rel[1].r_info),
- R_PPC_NONE);
+ rel[1].r_info = ELF32_R_INFO (STN_UNDEF, R_PPC_NONE);
insn2 = 0x7c631214; /* add 3,3,2 */
bfd_put_32 (output_bfd, insn2, contents + offset);
}
@@ -7005,8 +7003,7 @@ ppc_elf_relocate_section (bfd *output_bfd,
bfd_put_32 (output_bfd, insn2, contents + offset);
/* Zap the reloc on the _tls_get_addr call too. */
BFD_ASSERT (offset == rel[1].r_offset);
- rel[1].r_info = ELF32_R_INFO (ELF32_R_SYM (rel[1].r_info),
- R_PPC_NONE);
+ rel[1].r_info = ELF32_R_INFO (STN_UNDEF, R_PPC_NONE);
}
break;
@@ -7035,8 +7032,7 @@ ppc_elf_relocate_section (bfd *output_bfd,
contents + rel->r_offset - d_offset);
/* Zap the reloc on the _tls_get_addr call too. */
BFD_ASSERT (rel->r_offset - d_offset == rel[1].r_offset);
- rel[1].r_info = ELF32_R_INFO (ELF32_R_SYM (rel[1].r_info),
- R_PPC_NONE);
+ rel[1].r_info = ELF32_R_INFO (STN_UNDEF, R_PPC_NONE);
rel--;
continue;
}