Fix a NULL dereference seen when assembling invalid input.
PR 27198
* config/tc-i386.c (need_plt32_p): Return FALSE for NULL symbol.
* testsuite/gas/i386/pr27198.d,
* gas/testsuite/gas/i386/pr27198.err,
* gas/testsuite/gas/i386/pr27198.s: New test.
* gas/testsuite/gas/i386/i386.exp: Run it.
+2021-01-18 Alan Modra <amodra@gmail.com>
+
+ PR 27198
+ * config/tc-i386.c (need_plt32_p): Return FALSE for NULL symbol.
+ * testsuite/gas/i386/pr27198.d,
+ * gas/testsuite/gas/i386/pr27198.err,
+ * gas/testsuite/gas/i386/pr27198.s: New test.
+ * gas/testsuite/gas/i386/i386.exp: Run it.
+
2021-01-15 Nelson Chu <nelson.chu@sifive.com>
* config/tc-riscv.c: Indent and GNU coding standards tidy,
if (!object_64bit)
return FALSE;
+ if (s == NULL)
+ return FALSE;
+
/* Weak or undefined symbol need PLT32 relocation. */
if (S_IS_WEAK (s) || !S_IS_DEFINED (s))
return TRUE;
}
}
+ run_dump_test pr27198
set ASFLAGS "$old_ASFLAGS --64"
--- /dev/null
+#as:
+#error_output: pr27198.err
--- /dev/null
+#failif
+
+#...
+.*Internal error.*
+#pass
--- /dev/null
+ call (%rax)junk