diff options
author | Nick Clifton <nickc@redhat.com> | 2014-04-02 16:29:35 +0100 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2014-04-02 16:29:35 +0100 |
commit | cad0da33dc43a207a7c4baf32223831b2d0ac60c (patch) | |
tree | 244fde7f7c77a5900a562609059257e4cad76823 | |
parent | 7a79c51466c30188d49d03d3e3593c87e5a3345e (diff) | |
download | gdb-cad0da33dc43a207a7c4baf32223831b2d0ac60c.zip gdb-cad0da33dc43a207a7c4baf32223831b2d0ac60c.tar.gz gdb-cad0da33dc43a207a7c4baf32223831b2d0ac60c.tar.bz2 |
This fixes an internal error in GAS, triggered by the test case reported in PR 16765.
The problem was that gcc was generating assembler with missing unwind directives in it,
so that a gas_assert was being triggered. The patch replaces the assert with an error
message.
* config/tc-arm.c (create_unwind_entry): Report an error if an
attempt to recreate an unwind directive is encountered.
-rw-r--r-- | gas/ChangeLog | 6 | ||||
-rw-r--r-- | gas/config/tc-arm.c | 9 |
2 files changed, 13 insertions, 2 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index bdb7c2f..c6b2bb5 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2014-04-02 Nick Clifton <nickc@redhat.com> + + PR gas/16765 + * config/tc-arm.c (create_unwind_entry): Report an error if an + attempt to recreate an unwind directive is encountered. + 2014-03-27 Nick Clifton <nickc@redhat.com> * config/tc-score.c (s3_parse_pce_inst): Add "%s" parameter to diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 69299c7..1795d37 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -20992,7 +20992,7 @@ start_unwind_section (const segT text_seg, int idx) /* Start an unwind table entry. HAVE_DATA is nonzero if we have additional personality routine data. Returns zero, or the index table value for - and inline entry. */ + an inline entry. */ static valueT create_unwind_entry (int have_data) @@ -21063,7 +21063,12 @@ create_unwind_entry (int have_data) } else { - gas_assert (unwind.personality_index == -1); + /* PR 16765: Missing or misplaced unwind directives can trigger this. */ + if (unwind.personality_index != -1) + { + as_bad (_("attempt to recreate an unwind entry")); + return 1; + } /* An extra byte is required for the opcode count. */ size = unwind.opcode_count + 1; |