aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2019-10-29 11:35:05 +1030
committerAlan Modra <amodra@gmail.com>2019-10-29 12:20:54 +1030
commitb9d8f5601bcfbe96ab0476286ae8e249ada10db5 (patch)
tree07b6b1daeba6597f6fbd54b823d3524005337509 /gas
parentd7b510baa8603e37080405e09e907248bee81d35 (diff)
downloadfsf-binutils-gdb-b9d8f5601bcfbe96ab0476286ae8e249ada10db5.zip
fsf-binutils-gdb-b9d8f5601bcfbe96ab0476286ae8e249ada10db5.tar.gz
fsf-binutils-gdb-b9d8f5601bcfbe96ab0476286ae8e249ada10db5.tar.bz2
Re: Optimise away eh_frame advance_loc 0
If we happen to get the fixed and variable parts of the advance_loc in different frags, bad things happen when subtracting one from a fr_fix of zero. PR 25125 * dw2gencfi.c (output_cfi_insn): Don't allow DW_CFA_advance_loc4 to be placed in a different frag to the rs_cfa.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/dw2gencfi.c7
2 files changed, 12 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 53c90ea..17f45e3 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2019-10-29 Alan Modra <amodra@gmail.com>
+
+ PR 25125
+ * dw2gencfi.c (output_cfi_insn): Don't allow DW_CFA_advance_loc4
+ to be placed in a different frag to the rs_cfa.
+
2019-10-26 John David Anglin <danglin@gcc.gnu.org>
PR gas/25121
diff --git a/gas/dw2gencfi.c b/gas/dw2gencfi.c
index b01e4c4..6c0478a 100644
--- a/gas/dw2gencfi.c
+++ b/gas/dw2gencfi.c
@@ -1630,7 +1630,12 @@ output_cfi_insn (struct cfi_insn_data *insn)
/* The code in ehopt.c expects that one byte of the encoding
is already allocated to the frag. This comes from the way
that it scans the .eh_frame section looking first for the
- .byte DW_CFA_advance_loc4. */
+ .byte DW_CFA_advance_loc4. Call frag_grow with the sum of
+ room needed by frag_more and frag_var to preallocate space
+ ensuring that the DW_CFA_advance_loc4 is in the fixed part
+ of the rs_cfa frag, so that the relax machinery can remove
+ the advance_loc should it advance by zero. */
+ frag_grow (5);
*frag_more (1) = DW_CFA_advance_loc4;
frag_var (rs_cfa, 4, 0, DWARF2_LINE_MIN_INSN_LENGTH << 3,