mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-24 12:23:31 +08:00
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.
This commit is contained in:
@ -1,3 +1,12 @@
|
||||
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,
|
||||
|
@ -8628,6 +8628,9 @@ need_plt32_p (symbolS *s)
|
||||
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;
|
||||
|
@ -1293,6 +1293,7 @@ if [gas_64_check] then {
|
||||
}
|
||||
|
||||
}
|
||||
run_dump_test pr27198
|
||||
|
||||
set ASFLAGS "$old_ASFLAGS --64"
|
||||
|
||||
|
2
gas/testsuite/gas/i386/pr27198.d
Normal file
2
gas/testsuite/gas/i386/pr27198.d
Normal file
@ -0,0 +1,2 @@
|
||||
#as:
|
||||
#error_output: pr27198.err
|
5
gas/testsuite/gas/i386/pr27198.err
Normal file
5
gas/testsuite/gas/i386/pr27198.err
Normal file
@ -0,0 +1,5 @@
|
||||
#failif
|
||||
|
||||
#...
|
||||
.*Internal error.*
|
||||
#pass
|
1
gas/testsuite/gas/i386/pr27198.s
Normal file
1
gas/testsuite/gas/i386/pr27198.s
Normal file
@ -0,0 +1 @@
|
||||
call (%rax)junk
|
Reference in New Issue
Block a user