aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2002-05-20 13:12:41 +0000
committerAlan Modra <amodra@gmail.com>2002-05-20 13:12:41 +0000
commitc862ae314db936536aea21a7b854c03e6a59431d (patch)
tree73c0729d1bdc577924f1649324f718bc0e3941df
parent56f6e91079f36a2e0b0bd74ec02f28c061b06951 (diff)
downloadgdb-c862ae314db936536aea21a7b854c03e6a59431d.zip
gdb-c862ae314db936536aea21a7b854c03e6a59431d.tar.gz
gdb-c862ae314db936536aea21a7b854c03e6a59431d.tar.bz2
* elf64-ppc.c (ppc_build_one_stub): Point undefined function syms
at the plt call stub.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf64-ppc.c14
2 files changed, 19 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 02b963f..01ec5b0 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2002-05-20 Alan Modra <amodra@bigpond.net.au>
+
+ * elf64-ppc.c (ppc_build_one_stub): Point undefined function syms
+ at the plt call stub.
+
2002-05-19 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
* cpu-mips.c (mips_compatible): Don't try to check machine
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index cd6fe7b..65ef453 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -4153,6 +4153,20 @@ ppc_build_one_stub (gen_entry, in_arg)
htab->sglink->_cooked_size = p - htab->sglink->contents;
htab->sglink->reloc_count += 1;
+ /* Do the best we can for shared libraries built without
+ exporting ".foo" for each "foo". This can happen when symbol
+ versioning scripts strip all bar a subset of symbols. */
+ if (stub_entry->h->oh->root.type != bfd_link_hash_defined
+ && stub_entry->h->oh->root.type != bfd_link_hash_defweak)
+ {
+ /* Point the symbol at the stub. There may be multiple stubs,
+ we don't really care; The main thing is to make this sym
+ defined somewhere. */
+ stub_entry->h->oh->root.type = bfd_link_hash_defined;
+ stub_entry->h->oh->root.u.def.section = stub_entry->stub_sec;
+ stub_entry->h->oh->root.u.def.value = stub_entry->stub_offset;
+ }
+
/* Now build the stub. */
off = stub_entry->h->elf.plt.offset;
if (off >= (bfd_vma) -2)