aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2010-02-08 00:48:27 +0000
committerAlan Modra <amodra@gmail.com>2010-02-08 00:48:27 +0000
commit06a162cf6325616071ef4c2fc19e8c4d05c64ac1 (patch)
treefee42c9ff59858711dfa9d7a13866a21e113b978
parent2d4d5659e7a7fa0f840f0fa23ff152fec2f4b3c6 (diff)
downloadgdb-06a162cf6325616071ef4c2fc19e8c4d05c64ac1.zip
gdb-06a162cf6325616071ef4c2fc19e8c4d05c64ac1.tar.gz
gdb-06a162cf6325616071ef4c2fc19e8c4d05c64ac1.tar.bz2
* elf32-ppc.c (ppc_elf_check_relocs): Remove dead ifunc code.
-rw-r--r--bfd/ChangeLog4
-rw-r--r--bfd/elf32-ppc.c59
2 files changed, 29 insertions, 34 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 82c99ad..740db2d 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,7 @@
+2010-02-08 Alan Modra <amodra@gmail.com>
+
+ * elf32-ppc.c (ppc_elf_check_relocs): Remove dead ifunc code.
+
2010-02-05 Sterling Augustine <sterling@tensilica.com>
* elf.c (assign_file_positions_for_load_sections) Update lma of
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index 539ff9d..c9f22bb 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -3447,7 +3447,6 @@ ppc_elf_check_relocs (bfd *abfd,
enum elf_ppc_reloc_type r_type;
struct elf_link_hash_entry *h;
int tls_type;
- struct plt_entry **ifunc;
r_symndx = ELF32_R_SYM (rel->r_info);
if (r_symndx < symtab_hdr->sh_info)
@@ -3475,46 +3474,38 @@ ppc_elf_check_relocs (bfd *abfd,
}
tls_type = 0;
- ifunc = NULL;
r_type = ELF32_R_TYPE (rel->r_info);
- if (!htab->is_vxworks)
+ if (h == NULL && !htab->is_vxworks)
{
- if (h != NULL)
- {
- if (h->type == STT_GNU_IFUNC)
- ifunc = &h->plt.plist;
- }
- else
+ Elf_Internal_Sym *isym = bfd_sym_from_r_symndx (&htab->sym_cache,
+ abfd, r_symndx);
+ if (isym == NULL)
+ return FALSE;
+
+ if (ELF_ST_TYPE (isym->st_info) == STT_GNU_IFUNC
+ && (!info->shared
+ || is_branch_reloc (r_type)))
{
- Elf_Internal_Sym *isym = bfd_sym_from_r_symndx (&htab->sym_cache,
- abfd, r_symndx);
- if (isym == NULL)
+ struct plt_entry **ifunc;
+ bfd_vma addend;
+
+ ifunc = update_local_sym_info (abfd, symtab_hdr, r_symndx,
+ PLT_IFUNC);
+ if (ifunc == NULL)
return FALSE;
- if (ELF_ST_TYPE (isym->st_info) == STT_GNU_IFUNC
- && (!info->shared
- || is_branch_reloc (r_type)))
+ /* STT_GNU_IFUNC symbols must have a PLT entry;
+ In a non-pie executable even when there are
+ no plt calls. */
+ addend = 0;
+ if (r_type == R_PPC_PLTREL24)
{
- bfd_vma addend;
-
- ifunc = update_local_sym_info (abfd, symtab_hdr, r_symndx,
- PLT_IFUNC);
- if (ifunc == NULL)
- return FALSE;
-
- /* STT_GNU_IFUNC symbols must have a PLT entry;
- In a non-pie executable even when there are
- no plt calls. */
- addend = 0;
- if (r_type == R_PPC_PLTREL24)
- {
- ppc_elf_tdata (abfd)->makes_plt_call = 1;
- if (info->shared)
- addend = rel->r_addend;
- }
- if (!update_plt_info (abfd, ifunc, got2, addend))
- return FALSE;
+ ppc_elf_tdata (abfd)->makes_plt_call = 1;
+ if (info->shared)
+ addend = rel->r_addend;
}
+ if (!update_plt_info (abfd, ifunc, got2, addend))
+ return FALSE;
}
}