diff options
author | Tamar Christina <tamar.christina@arm.com> | 2018-10-03 18:50:15 +0100 |
---|---|---|
committer | Tamar Christina <tamar.christina@arm.com> | 2018-10-03 18:50:40 +0100 |
commit | 4f5d2536289c0aedc3234f1bff6e9f4284f267c5 (patch) | |
tree | 1815012384509dd44b2d4f095f1fd6ee5c836fd8 /gas | |
parent | a68f4cd235a36776d3d9fea7291163b8d8e35869 (diff) | |
download | gdb-4f5d2536289c0aedc3234f1bff6e9f4284f267c5.zip gdb-4f5d2536289c0aedc3234f1bff6e9f4284f267c5.tar.gz gdb-4f5d2536289c0aedc3234f1bff6e9f4284f267c5.tar.bz2 |
AArch64: Close sequences at the end of sections
Any open sequence at the end of a section or assembly is considered an error.
This patch adds a check at the end to ensure that all sequences have been closed
and if not reports a warning.
During disassembly it's not possible to detect this condition in the back-end so
the warning is only emitted from the assembler for now.
gas/
* config/tc-aarch64.c (force_automatic_sequence_close,
aarch64_frob_section): New.
* config/tc-aarch64.h (tc_frob_section, aarch64_frob_section): New.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 6 | ||||
-rw-r--r-- | gas/config/tc-aarch64.c | 18 | ||||
-rw-r--r-- | gas/config/tc-aarch64.h | 3 |
3 files changed, 27 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index b4cafbb..56609f4 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,5 +1,11 @@ 2018-10-03 Tamar Christina <tamar.christina@arm.com> + * config/tc-aarch64.c (force_automatic_sequence_close, + aarch64_frob_section): New. + * config/tc-aarch64.h (tc_frob_section, aarch64_frob_section): New. + +2018-10-03 Tamar Christina <tamar.christina@arm.com> + * config/tc-aarch64.c (output_operand_error_report): Order warnings. 2018-10-03 Tamar Christina <tamar.christina@arm.com> diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c index a5fe6bc..085ffa2 100644 --- a/gas/config/tc-aarch64.c +++ b/gas/config/tc-aarch64.c @@ -6738,6 +6738,17 @@ warn_unpredictable_ldst (aarch64_instruction *instr, char *str) } } +static void +force_automatic_sequence_close (void) +{ + if (now_instr_sequence.instr) + { + as_warn (_("previous `%s' sequence has not been closed"), + now_instr_sequence.instr->opcode->name); + init_insn_sequence (NULL, &now_instr_sequence); + } +} + /* A wrapper function to interface with libopcodes on encoding and record the error message if there is any. @@ -6931,6 +6942,13 @@ aarch64_frob_label (symbolS * sym) dwarf2_emit_label (sym); } +void +aarch64_frob_section (asection *sec ATTRIBUTE_UNUSED) +{ + /* Check to see if we have a block to close. */ + force_automatic_sequence_close (); +} + int aarch64_data_in_code (void) { diff --git a/gas/config/tc-aarch64.h b/gas/config/tc-aarch64.h index cdf9883..88df2aa 100644 --- a/gas/config/tc-aarch64.h +++ b/gas/config/tc-aarch64.h @@ -78,6 +78,8 @@ struct aarch64_fix /* We also need to mark assembler created symbols: */ #define tc_frob_fake_label(S) aarch64_frob_label (S) +#define tc_frob_section(S) aarch64_frob_section (S) + #define TC_FIX_TYPE struct aarch64_fix #define TC_INIT_FIX_DATA(FIX) { (FIX)->tc_fix_data.inst = NULL; \ (FIX)->tc_fix_data.opnd = AARCH64_OPND_NIL; } @@ -218,6 +220,7 @@ extern int aarch64_force_relocation (struct fix *); extern void aarch64_cleanup (void); extern void aarch64_start_line_hook (void); extern void aarch64_frob_label (symbolS *); +extern void aarch64_frob_section (asection *sec); extern int aarch64_data_in_code (void); extern char * aarch64_canonicalize_symbol_name (char *); extern void aarch64_adjust_symtab (void); |