aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-ppc.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2008-08-11 14:38:40 +0000
committerAlan Modra <amodra@gmail.com>2008-08-11 14:38:40 +0000
commit90aecf7a80c1cefeb45fc10a6cd02c8338e34b4c (patch)
treee3c03b90066a0ec5f88f08d29552b8c75d039675 /bfd/elf64-ppc.c
parent818236e51ddfafe9688b99e1ce5ddc3d2dc4a0a9 (diff)
downloadgdb-90aecf7a80c1cefeb45fc10a6cd02c8338e34b4c.zip
gdb-90aecf7a80c1cefeb45fc10a6cd02c8338e34b4c.tar.gz
gdb-90aecf7a80c1cefeb45fc10a6cd02c8338e34b4c.tar.bz2
* elf64-ppc.c (toc_adjusting_stub_needed): Any call via the plt
needs r2 valid, not just those to external syms.
Diffstat (limited to 'bfd/elf64-ppc.c')
-rw-r--r--bfd/elf64-ppc.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 727b6ac..3ee3f69 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -9184,6 +9184,7 @@ toc_adjusting_stub_needed (struct bfd_link_info *info, asection *isec)
enum elf_ppc64_reloc_type r_type;
unsigned long r_symndx;
struct elf_link_hash_entry *h;
+ struct ppc_link_hash_entry *eh;
Elf_Internal_Sym *sym;
asection *sym_sec;
struct _opd_sec_data *opd;
@@ -9206,24 +9207,21 @@ toc_adjusting_stub_needed (struct bfd_link_info *info, asection *isec)
}
/* Calls to dynamic lib functions go through a plt call stub
- that uses r2. Branches to undefined symbols might be a call
- using old-style dot symbols that can be satisfied by a plt
- call into a new-style dynamic library. */
- if (sym_sec == NULL)
+ that uses r2. */
+ eh = (struct ppc_link_hash_entry *) h;
+ if (eh != NULL
+ && (eh->elf.plt.plist != NULL
+ || (eh->oh != NULL
+ && eh->oh->elf.plt.plist != NULL)))
{
- struct ppc_link_hash_entry *eh = (struct ppc_link_hash_entry *) h;
- if (eh != NULL
- && eh->oh != NULL
- && eh->oh->elf.plt.plist != NULL)
- {
- ret = 1;
- break;
- }
-
- /* Ignore other undefined symbols. */
- continue;
+ ret = 1;
+ break;
}
+ if (sym_sec == NULL)
+ /* Ignore other undefined symbols. */
+ continue;
+
/* Assume branches to other sections not included in the link need
stubs too, to cover -R and absolute syms. */
if (sym_sec->output_section == NULL)