Optimise away eh_frame advance_loc 0
authorAlan Modra <amodra@gmail.com>
Sat, 26 Oct 2019 08:08:26 +0000 (18:38 +1030)
committerAlan Modra <amodra@gmail.com>
Sat, 26 Oct 2019 09:49:28 +0000 (20:19 +1030)
commit6f69abb0498286297936a178ba81c7e445aa4437
tree7a5d73d08dad01d2423566cffb48b48cda5971a1
parent30baf67b6505d903bf678f9a0ba3645eb337ce49
Optimise away eh_frame advance_loc 0

These can be generated when multiple cfi directives are emitted for an
instruction and the insn frag is closed off between directives, as
happens when listings are enabled.  No doubt the advance_loc of zero
could be avoided by backtracking over frags in dw2gencfi.c before
calling cfi_add_advance_loc, but that seems like more work than
cleaning up afterwards as this patch does.

Noticed when looking at the testcase in PR25125.

PR 25125
* dw2gencfi.c (output_cfi_insn): Don't output DW_CFA_advance_loc+0.
* ehopt.c (eh_frame_estimate_size_before_relax): Return -1 for
an advance_loc of zero.
(eh_frame_relax_frag): Translate fr_subtype of 7 to size -1.
(eh_frame_convert_frag): Handle fr_subtype of 7.  Abort on
unexpected fr_subtype.
gas/ChangeLog
gas/dw2gencfi.c
gas/ehopt.c
This page took 0.026283 seconds and 4 git commands to generate.