aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2020-04-16 18:02:10 +0100
committerNick Clifton <nickc@redhat.com>2020-04-16 18:02:10 +0100
commit8e4979ac1ea78147ecbcbf81af5e946873dda079 (patch)
tree252ac62bb315754080925a2bca4cb3f4db59a4f0 /gas
parent7a1a12f4d1c6152017142d74c736dc1cc6b0e81c (diff)
downloadfsf-binutils-gdb-8e4979ac1ea78147ecbcbf81af5e946873dda079.zip
fsf-binutils-gdb-8e4979ac1ea78147ecbcbf81af5e946873dda079.tar.gz
fsf-binutils-gdb-8e4979ac1ea78147ecbcbf81af5e946873dda079.tar.bz2
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.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog11
-rw-r--r--gas/config/obj-elf.c4
-rw-r--r--gas/testsuite/gas/elf/elf.exp5
-rw-r--r--gas/testsuite/gas/elf/type-noifunc.e2
4 files changed, 19 insertions, 3 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 09ad599..e0c51eb 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,14 @@
+2020-04-16 Gagan Singh Sidhu <broly@mac.com>
+ Nick Clifton <nickc@redhat.com>
+
+ PR 25803
+ * 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.
+
2020-02-16 David Faust <david.faust@oracle.com>
* testsuite/gas/bpf/bpf.exp: Run jump32 tests.
diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
index a6dcdaf..5e7e8f0 100644
--- a/gas/config/obj-elf.c
+++ b/gas/config/obj-elf.c
@@ -2177,6 +2177,10 @@ obj_elf_type (int ignore ATTRIBUTE_UNUSED)
&& bed->elf_osabi != ELFOSABI_FREEBSD)
as_bad (_("symbol type \"%s\" is supported only by GNU "
"and FreeBSD targets"), type_name);
+ /* MIPS targets do not support IFUNCS. */
+ else if (bed->target_id == MIPS_ELF_DATA)
+ as_bad (_("symbol type \"%s\" is not supported by "
+ "MIPS targets"), type_name);
elf_tdata (stdoutput)->has_gnu_osabi |= elf_gnu_osabi_ifunc;
type = BSF_FUNCTION | BSF_GNU_INDIRECT_FUNCTION;
}
diff --git a/gas/testsuite/gas/elf/elf.exp b/gas/testsuite/gas/elf/elf.exp
index c80175c..31026e4 100644
--- a/gas/testsuite/gas/elf/elf.exp
+++ b/gas/testsuite/gas/elf/elf.exp
@@ -220,8 +220,9 @@ if { [is_elf_format] } then {
# in the symbol type test.
# We also need to exclude targets that do not support unique objects.
if { [istarget "*-*-hpux*"]
- || [istarget "arm*-*-*"]
- || [istarget "msp*-*-*"]
+ || [istarget "arm*-*-*"]
+ || [istarget "mips*-*-*"]
+ || [istarget "msp*-*-*"]
|| [istarget "visium-*-*"]
|| ![supports_gnu_unique]
} then {
diff --git a/gas/testsuite/gas/elf/type-noifunc.e b/gas/testsuite/gas/elf/type-noifunc.e
index ddeadd7..76a42d0 100644
--- a/gas/testsuite/gas/elf/type-noifunc.e
+++ b/gas/testsuite/gas/elf/type-noifunc.e
@@ -1,5 +1,5 @@
+.: 0+0 +1 +FUNC +LOCAL +DEFAULT +. function
+.: 0+0 +1 +OBJECT +LOCAL +DEFAULT +. object
- +.: 0+1 +1 +TLS +LOCAL +DEFAULT +. tls_object
+ +[0-9]+: 0+1 +1 +TLS +LOCAL +DEFAULT +. tls_object
+..: 0+2 +1 +NOTYPE +LOCAL +DEFAULT +. notype
+..: 0+1 +1 +(COMMON|OBJECT) +GLOBAL +DEFAULT +(ANSI_|)COM common