diff options
author | Alan Modra <amodra@gmail.com> | 2004-08-18 10:11:02 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2004-08-18 10:11:02 +0000 |
commit | c09bdfe5c9896f7197a7fe5e504ff384b147908b (patch) | |
tree | f356c7d53911129bdb70bf3520a961ea264c5895 /bfd/elf64-ppc.c | |
parent | d6afba4b7d881f62bc632a9c2883ac0fdfd02e3a (diff) | |
download | gdb-c09bdfe5c9896f7197a7fe5e504ff384b147908b.zip gdb-c09bdfe5c9896f7197a7fe5e504ff384b147908b.tar.gz gdb-c09bdfe5c9896f7197a7fe5e504ff384b147908b.tar.bz2 |
* elf64-ppc.c (func_desc_adjust): Give undefined dot-symbols a value
if we can look up their function descriptor in a regular file.
Diffstat (limited to 'bfd/elf64-ppc.c')
-rw-r--r-- | bfd/elf64-ppc.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index ed679c2..33ffd39 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -5061,6 +5061,24 @@ func_desc_adjust (struct elf_link_hash_entry *h, void *inf) info = inf; htab = ppc_hash_table (info); + /* Resolve undefined references to dot-symbols as the value + in the function descriptor, if we have one in a regular object. + This is to satisfy cases like ".quad .foo". Calls to functions + in dynamic objects are handled elsewhere. */ + if (fh->elf.root.type == bfd_link_hash_undefweak + && fh->was_undefined + && (fh->oh->elf.root.type == bfd_link_hash_defined + || fh->oh->elf.root.type == bfd_link_hash_defweak) + && get_opd_info (fh->oh->elf.root.u.def.section) != NULL + && opd_entry_value (fh->oh->elf.root.u.def.section, + fh->oh->elf.root.u.def.value, + &fh->elf.root.u.def.section, + &fh->elf.root.u.def.value) != (bfd_vma) -1) + { + fh->elf.root.type = fh->oh->elf.root.type; + fh->elf.elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL; + } + /* If this is a function code symbol, transfer dynamic linking information to the function descriptor symbol. */ if (!fh->is_func) |