aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-ppc.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2002-10-08 09:51:09 +0000
committerAlan Modra <amodra@gmail.com>2002-10-08 09:51:09 +0000
commit51020317eecbada9ce6f0991f85e852c552add37 (patch)
treec8db2b9b16ccf238abde537236883c718bdb35d4 /bfd/elf64-ppc.c
parentd8ac458a3860da75ef018cb03cbc40c0c01fee6e (diff)
downloadgdb-51020317eecbada9ce6f0991f85e852c552add37.zip
gdb-51020317eecbada9ce6f0991f85e852c552add37.tar.gz
gdb-51020317eecbada9ce6f0991f85e852c552add37.tar.bz2
* elf64-ppc.c (edit_opd): Correct test for discarded sections.
Diffstat (limited to 'bfd/elf64-ppc.c')
-rw-r--r--bfd/elf64-ppc.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index bf2a6d7..37b30e6 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -3675,12 +3675,16 @@ edit_opd (obfd, info)
break;
}
- if (sym_sec->output_section == bfd_abs_section_ptr)
- {
- /* OK, we've found a function that's excluded from the
- link. */
- need_edit = true;
- }
+ /* opd entries are always for functions defined in the
+ current input bfd. If the symbol isn't defined in the
+ input bfd, then we won't be using the function in this
+ bfd; It must be defined in a linkonce section in another
+ bfd, or is weak. It's also possible that we are
+ discarding the function due to a linker script /DISCARD/,
+ which we test for via the output_section. */
+ if (sym_sec->owner != ibfd
+ || sym_sec->output_section == bfd_abs_section_ptr)
+ need_edit = true;
offset += 24;
}
@@ -3754,7 +3758,8 @@ edit_opd (obfd, info)
sym->st_shndx);
}
- skip = sym_sec->output_section == bfd_abs_section_ptr;
+ skip = (sym_sec->owner != ibfd
+ || sym_sec->output_section == bfd_abs_section_ptr);
if (skip)
{
if (h != NULL)