diff options
author | Alan Modra <amodra@gmail.com> | 2021-01-18 09:38:22 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2021-01-18 15:13:10 +1030 |
commit | 44365e88c0e021a7f734e44aa845f1e96cd83389 (patch) | |
tree | d6de8abcb4c044ee0bc60e82c4fec15ed3396d18 /gas/testsuite | |
parent | 994b25132814f4c2be93ce53a616a74139c4cf3c (diff) | |
download | binutils-44365e88c0e021a7f734e44aa845f1e96cd83389.zip binutils-44365e88c0e021a7f734e44aa845f1e96cd83389.tar.gz binutils-44365e88c0e021a7f734e44aa845f1e96cd83389.tar.bz2 |
PR27198, segv in S_IS_WEAK
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.
Diffstat (limited to 'gas/testsuite')
-rw-r--r-- | gas/testsuite/gas/i386/i386.exp | 1 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/pr27198.d | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/pr27198.err | 5 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/pr27198.s | 1 |
4 files changed, 9 insertions, 0 deletions
diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp index c9bca8a..b4a75e4 100644 --- a/gas/testsuite/gas/i386/i386.exp +++ b/gas/testsuite/gas/i386/i386.exp @@ -1293,6 +1293,7 @@ if [gas_64_check] then { } } + run_dump_test pr27198 set ASFLAGS "$old_ASFLAGS --64" diff --git a/gas/testsuite/gas/i386/pr27198.d b/gas/testsuite/gas/i386/pr27198.d new file mode 100644 index 0000000..6cf0d54 --- /dev/null +++ b/gas/testsuite/gas/i386/pr27198.d @@ -0,0 +1,2 @@ +#as: +#error_output: pr27198.err diff --git a/gas/testsuite/gas/i386/pr27198.err b/gas/testsuite/gas/i386/pr27198.err new file mode 100644 index 0000000..1f71543 --- /dev/null +++ b/gas/testsuite/gas/i386/pr27198.err @@ -0,0 +1,5 @@ +#failif + +#... +.*Internal error.* +#pass diff --git a/gas/testsuite/gas/i386/pr27198.s b/gas/testsuite/gas/i386/pr27198.s new file mode 100644 index 0000000..9ac9898 --- /dev/null +++ b/gas/testsuite/gas/i386/pr27198.s @@ -0,0 +1 @@ + call (%rax)junk |