diff options
author | Jan Beulich <jbeulich@novell.com> | 2015-01-12 15:24:20 +0100 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2015-01-12 15:24:20 +0100 |
commit | 696025802ec3273fde5cbf82c215a3d795435c1a (patch) | |
tree | a48fff046770366376dad6bcf409bc651277b2da /gas/dw2gencfi.h | |
parent | 3c758495736df25d141a4ea13c7aba24f5bb9753 (diff) | |
download | binutils-696025802ec3273fde5cbf82c215a3d795435c1a.zip binutils-696025802ec3273fde5cbf82c215a3d795435c1a.tar.gz binutils-696025802ec3273fde5cbf82c215a3d795435c1a.tar.bz2 |
gas: allow labeling of CFI instructions
When runtime patching code (like e.g. done by the Linux kernel) there
may be cases where the set of stack frame alterations differs between
unpatched and patched code. Consequently the corresponding unwind data
needs patching too. Locating the right places within an FDE, however,
is rather cumbersome without a way to insert labels in the resulting
section. Hence this patch introduces a new directive, .cfi_label. Note
that with the way CFI data gets emitted currently (at the end of the
assembly process) this can't support local FB- and dollar-labels.
gas/
2015-01-12 Jan Beulich <jbeulich@suse.com>
* gas/dw2gencfi.c (cfi_add_label, dot_cfi_label): New.
(cfi_pseudo_table): Add "cfi_label".
(output_cfi_insn): Handle CFI_label.
(select_cie_for_fde): Als terminate CIE when encountering
CFI_label.
* dw2gencfi.h (cfi_add_label): Declare.
(struct cfi_insn_data): New member "sym_name".
(CFI_label): New.
* read.c (read_symbol_name): Drop "static".
* read.h (read_symbol_name): Declare.
gas/testsuite/
2015-01-12 Jan Beulich <jbeulich@suse.com>
gas/cfi/cfi-label.d, gas/cfi/cfi-label.s: New.
gas/cfi/cfi.exp: Run new tests.
Diffstat (limited to 'gas/dw2gencfi.h')
-rw-r--r-- | gas/dw2gencfi.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gas/dw2gencfi.h b/gas/dw2gencfi.h index e80b19e..6e2c50e 100644 --- a/gas/dw2gencfi.h +++ b/gas/dw2gencfi.h @@ -37,6 +37,7 @@ extern void cfi_new_fde (struct symbol *); extern void cfi_end_fde (struct symbol *); extern void cfi_set_return_column (unsigned); extern void cfi_add_advance_loc (struct symbol *); +extern void cfi_add_label (const char *); extern void cfi_add_CFA_offset (unsigned, offsetT); extern void cfi_add_CFA_def_cfa (unsigned, offsetT); @@ -94,6 +95,8 @@ struct cfi_insn_data unsigned reg, encoding; expressionS exp; } ea; + + const char *sym_name; } u; }; @@ -128,5 +131,6 @@ extern struct fde_entry *all_fde_data; #define CFI_escape 0x103 #define CFI_signal_frame 0x104 #define CFI_val_encoded_addr 0x105 +#define CFI_label 0x106 #endif /* DW2GENCFI_H */ |