This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [RFA] CFI improvements
- From: Andreas Jaeger <aj at suse dot de>
- To: Michal Ludvig <mludvig at suse dot cz>
- Cc: binutils at sources dot redhat dot com, Alan Modra <amodra at bigpond dot net dot au>
- Date: Tue, 20 May 2003 14:55:47 +0200
- Subject: Re: [RFA] CFI improvements
- References: <3ECA1DBE.7080603@suse.cz>
Michal Ludvig <mludvig@suse.cz> writes:
> Hi,
> the attached patch adds some new features to the CFI engine:
> - register names can start with '%' as requested by GCC guys.
> - CIEs are not duplicated anymore but instead reused if possible.
> - tc_cfi_init() is moved from main() to dot_cfi_startproc() -
> otherwise it didn't set correct values on amd64 because the output
> format wasn't yet known in main().
> - .cfi_startproc takes optional parameter 'simple' that disables
> emitting of architecture-dependent initial instructions.
> - testsuite is modified to pass with CIE optimalization.
>
> I hope I haven't introduce any new C89 incompatibility (sorry for that one).
>
> Comments? Approvals?
>
> Michal Ludvig
> Index: dw2gencfi.c
> ===================================================================
> RCS file: /cvs/src/src/gas/dw2gencfi.c,v
> retrieving revision 1.2
> diff -u -p -r1.2 dw2gencfi.c
> --- dw2gencfi.c 20 May 2003 11:35:45 -0000 1.2
> +++ dw2gencfi.c 20 May 2003 12:04:30 -0000
> @@ -23,24 +23,55 @@
> #include "as.h"
> #include "dw2gencfi.h"
>
> +struct cie_entry
> +{
> + unsigned long offset;
> + size_t size;
> + void *data;
> + struct cie_entry *next;
> +};
> +
> +struct cfi_data
> +{
> + enum cfi_insn insn;
> + long param[2];
> + struct cfi_data *next;
> +};
> +
> +struct cfi_info
> +{
> + addressT start_address;
> + addressT end_address;
> + addressT last_address;
> + const char *labelname;
> + struct cfi_data *data;
> + struct cfi_info *next;
> +};
> +
> +/* Current open CFI entry. */
> +static struct cfi_info *cfi_info;
> +
> +/* List of CIEs so that they could be reused. */
> +static struct cie_entry *cie_root;
> +
> /* Current target config. */
> static struct cfi_config current_config;
>
> /* This is the main entry point to the CFI machinery. */
> static void dot_cfi (int arg);
>
> -const pseudo_typeS cfi_pseudo_table[] =
> - {
> - { "cfi_verbose", dot_cfi, CFI_verbose },
> - { "cfi_startproc", dot_cfi, CFI_startproc },
> - { "cfi_endproc", dot_cfi, CFI_endproc },
> - { "cfi_def_cfa", dot_cfi, CFA_def_cfa },
> - { "cfi_def_cfa_register", dot_cfi, CFA_def_cfa_register },
> - { "cfi_def_cfa_offset", dot_cfi, CFA_def_cfa_offset },
> - { "cfi_adjust_cfa_offset", dot_cfi, CFI_adjust_cfa_offset },
> - { "cfi_offset", dot_cfi, CFA_offset },
> - { NULL, NULL, 0 }
> - };
> +const pseudo_typeS cfi_pseudo_table[] = {
> + {"cfi_verbose", dot_cfi, CFI_verbose},
> + {"cfi_startproc", dot_cfi, CFI_startproc},
> + {"cfi_endproc", dot_cfi, CFI_endproc},
> + {"cfi_def_cfa", dot_cfi, CFA_def_cfa},
> + {"cfi_def_cfa_register", dot_cfi, CFA_def_cfa_register},
> + {"cfi_def_cfa_offset", dot_cfi, CFA_def_cfa_offset},
> + {"cfi_adjust_cfa_offset", dot_cfi, CFI_adjust_cfa_offset},
> + {"cfi_offset", dot_cfi, CFA_offset},
> + {"cfi_register", dot_cfi, CFA_register},
> + {NULL, NULL, 0}
> +};
These look like whitespace changes. Alan has done a number of
formatting changes, can you incorporate them cleanly into your patch
and then resend the patch? Reverting Alan's formatting changes is not
the right way IMO.
> [...]
> + char *simple = "simple";
const char?
Andreas
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj