diff options
author | Alan Modra <amodra@gmail.com> | 2013-12-03 15:01:20 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2013-12-03 15:16:12 +1030 |
commit | 2c3f079f58204594bc271b919a643e9f2813aa12 (patch) | |
tree | ca451f2e7884e557829e24f0da7435cebf251588 /bfd/elf64-ppc.c | |
parent | 2ea126fa785cf0d2b26cdba5c6ad8b8548b7ef15 (diff) | |
download | gdb-2c3f079f58204594bc271b919a643e9f2813aa12.zip gdb-2c3f079f58204594bc271b919a643e9f2813aa12.tar.gz gdb-2c3f079f58204594bc271b919a643e9f2813aa12.tar.bz2 |
PowerPC64 linking of --just-symbols objects (klibc)
With -mcmodel=medium we can't assume that a -R object doesn't use
toc-relative addressing if there's no toc. Lots of things are
accessed via r2, not just the toc/got section. Also, testing for
.opd is plain wrong for ELFv2.
* elf64-ppc.c (ppc64_elf_link_just_syms): Remove .got check.
Handle ELFv2.
Diffstat (limited to 'bfd/elf64-ppc.c')
-rw-r--r-- | bfd/elf64-ppc.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 489ea79..4bbb70f 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -5001,10 +5001,8 @@ ppc64_elf_link_just_syms (asection *sec, struct bfd_link_info *info) && (sec->owner->flags & (EXEC_P | DYNAMIC)) != 0 && is_ppc64_elf (sec->owner)) { - asection *got = bfd_get_section_by_name (sec->owner, ".got"); - if (got != NULL - && got->size >= elf_backend_got_header_size - && bfd_get_section_by_name (sec->owner, ".opd") != NULL) + if (abiversion (sec->owner) >= 2 + || bfd_get_section_by_name (sec->owner, ".opd") != NULL) sec->has_toc_reloc = 1; } _bfd_elf_link_just_syms (sec, info); |