From 8e4979ac1ea78147ecbcbf81af5e946873dda079 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Thu, 16 Apr 2020 18:02:10 +0100 Subject: Stop the MIPS assembler from accepting ifunc symbols. PR 25803 gas * config/obj-elf.c (obj_elf_type): Reject ifunc symbols on MIPS targets. * testsuite/gas/elf/elf.exp: Add MIPS targets to the list to skip for the type-2 test. * testsuite/gas/elf/type-noifunc.e: Update to allow for MIPS targets running this test. bfd * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Replace an abort with a more helpful error message. --- bfd/ChangeLog | 6 ++++++ bfd/elfxx-mips.c | 21 +++++++++++++++------ 2 files changed, 21 insertions(+), 6 deletions(-) (limited to 'bfd') diff --git a/bfd/ChangeLog b/bfd/ChangeLog index bb6b9f2..7f361d7 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2020-04-16 Nick Clifton + + PR 25803 + * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Replace an + abort with a more helpful error message. + 2020-04-16 Alan Modra PR 25827 diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index ae84782..2f26d7a 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -9311,12 +9311,21 @@ _bfd_mips_elf_adjust_dynamic_symbol (struct bfd_link_info *info, hmips = (struct mips_elf_link_hash_entry *) h; /* Make sure we know what is going on here. */ - BFD_ASSERT (dynobj != NULL - && (h->needs_plt - || h->is_weakalias - || (h->def_dynamic - && h->ref_regular - && !h->def_regular))); + if (dynobj == NULL + || (! h->needs_plt + && ! h->is_weakalias + && (! h->def_dynamic + || ! h->ref_regular + || h->def_regular))) + { + if (h->type == STT_GNU_IFUNC) + _bfd_error_handler (_("IFUNC symbol %s in dynamic symbol table - IFUNCS are not supported"), + h->root.root.string); + else + _bfd_error_handler (_("non-dynamic symbol %s in dynamic symbol table"), + h->root.root.string); + return TRUE; + } hmips = (struct mips_elf_link_hash_entry *) h; -- cgit v1.1