aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-ppc.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2011-09-06 07:41:24 +0000
committerAlan Modra <amodra@gmail.com>2011-09-06 07:41:24 +0000
commitb140b0101b2641e96c39ce022cd79fe7db3b7322 (patch)
tree9c02099b4953c90aad38cc95d485ecdda03ff5ca /bfd/elf64-ppc.c
parent79610daafd58cda25d75451b60cb07353a98d1e7 (diff)
downloadgdb-b140b0101b2641e96c39ce022cd79fe7db3b7322.zip
gdb-b140b0101b2641e96c39ce022cd79fe7db3b7322.tar.gz
gdb-b140b0101b2641e96c39ce022cd79fe7db3b7322.tar.bz2
PR ld/13131
* elf64-ppc.c (adjust_toc_syms): Delete redundant code. (ppc64_elf_edit_toc): Fix style nit. Report some details on linker failure due to reference in debug or non-alloc sections to optimized away toc entry, and don't abort.
Diffstat (limited to 'bfd/elf64-ppc.c')
-rw-r--r--bfd/elf64-ppc.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index b71a11b..8c14c0c 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -7881,9 +7881,6 @@ adjust_toc_syms (struct elf_link_hash_entry *h, void *inf)
struct adjust_toc_info *toc_inf = (struct adjust_toc_info *) inf;
unsigned long i;
- if (h->root.type == bfd_link_hash_indirect)
- return TRUE;
-
if (h->root.type != bfd_link_hash_defined
&& h->root.type != bfd_link_hash_defweak)
return TRUE;
@@ -8267,7 +8264,7 @@ ppc64_elf_edit_toc (struct bfd_link_info *info)
some_unused = 1;
last = 0;
}
- else if (*drop & ref_from_discarded)
+ else if ((*drop & ref_from_discarded) != 0)
{
some_unused = 1;
last = ref_from_discarded;
@@ -8385,7 +8382,13 @@ ppc64_elf_edit_toc (struct bfd_link_info *info)
break;
default:
- abort ();
+ info->callbacks->einfo
+ (_("%P: %H: %s relocation references "
+ "optimized away TOC entry\n"),
+ ibfd, sec, rel->r_offset,
+ ppc64_elf_howto_table[r_type]->name);
+ bfd_set_error (bfd_error_bad_value);
+ goto error_ret;
}
rel->r_addend = tocrel->r_addend;
elf_section_data (sec)->relocs = relstart;