This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] Fix ICE in assembler when passed a corrupt input file.
- From: Nick Clifton <nickc at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 1 Dec 2016 10:39:19 -0000
- Subject: [binutils-gdb] Fix ICE in assembler when passed a corrupt input file.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6d6ad65b43efa17a825702297331fcb290445a18
commit 6d6ad65b43efa17a825702297331fcb290445a18
Author: Nick Clifton <nickc@redhat.com>
Date: Thu Dec 1 10:38:40 2016 +0000
Fix ICE in assembler when passed a corrupt input file.
PR gas/20895
* symbols.c (resolve_symbol_value): Gracefully handle erroneous
symbolic expressions.
Diff:
---
gas/ChangeLog | 6 ++++++
gas/symbols.c | 11 ++++++++++-
2 files changed, 16 insertions(+), 1 deletion(-)
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;