diff options
author | Nick Clifton <nickc@redhat.com> | 2016-12-01 10:38:40 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2016-12-01 10:38:40 +0000 |
commit | 6d6ad65b43efa17a825702297331fcb290445a18 (patch) | |
tree | cf11a55d52a66b3ee631b83a9f5fea7311ee6129 /gas | |
parent | a37a2806e3289294ed214aed3c8a45db46026b39 (diff) | |
download | gdb-6d6ad65b43efa17a825702297331fcb290445a18.zip gdb-6d6ad65b43efa17a825702297331fcb290445a18.tar.gz gdb-6d6ad65b43efa17a825702297331fcb290445a18.tar.bz2 |
Fix ICE in assembler when passed a corrupt input file.
PR gas/20895
* symbols.c (resolve_symbol_value): Gracefully handle erroneous
symbolic expressions.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 6 | ||||
-rw-r--r-- | gas/symbols.c | 11 |
2 files changed, 16 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index e8912cd..385ff56 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2016-12-01 Nick Clifton <nickc@redhat.com> + + PR gas/20895 + * symbols.c (resolve_symbol_value): Gracefully handle erroneous + symbolic expressions. + 2016-11-29 Claudiu Zissulescu <claziss@synopsys.com> * config/tc-arc.c (find_opcode_match): New function argument diff --git a/gas/symbols.c b/gas/symbols.c index 9115d7e..66865e0 100644 --- a/gas/symbols.c +++ b/gas/symbols.c @@ -1429,7 +1429,16 @@ resolve_symbol_value (symbolS *symp) case O_gt: left = left > right ? ~ (offsetT) 0 : 0; break; case O_logical_and: left = left && right; break; case O_logical_or: left = left || right; break; - default: abort (); + + case O_illegal: + case O_absent: + case O_constant: + /* See PR 20895 for a reproducer. */ + as_bad (_("Invalid operation on symbol")); + goto exit_dont_set_value; + + default: + abort (); } final_val += symp->sy_frag->fr_address + left; |