PR27723, Internal error in select_cie_for_fde

Alan Modra amodra@gmail.com
Tue Apr 13 22:52:35 GMT 2021


This patch updates select_cie_for_fde to handle codes that may appear
at the start of an FDE.

	PR 27723
	* dw2gencfi.c (select_cie_for_fde): Handle DW_CFA_val_offset,
	DW_CFA_GNU_window_save and DW_CFA_restore_state.

diff --git a/gas/dw2gencfi.c b/gas/dw2gencfi.c
index 84029940b2e..ffaef52cd59 100644
--- a/gas/dw2gencfi.c
+++ b/gas/dw2gencfi.c
@@ -2100,6 +2100,7 @@ select_cie_for_fde (struct fde_entry *fde, bool eh_frame,
 
 	    case DW_CFA_offset:
 	    case DW_CFA_def_cfa:
+	    case DW_CFA_val_offset:
 	      if (i->u.ri.reg != j->u.ri.reg)
 		goto fail;
 	      if (i->u.ri.offset != j->u.ri.offset)
@@ -2129,6 +2130,8 @@ select_cie_for_fde (struct fde_entry *fde, bool eh_frame,
 	    case CFI_escape:
 	    case CFI_val_encoded_addr:
 	    case CFI_label:
+	    case DW_CFA_restore_state:
+	    case DW_CFA_GNU_window_save:
 	      /* Don't bother matching these for now.  */
 	      goto fail;
 
@@ -2144,6 +2147,7 @@ select_cie_for_fde (struct fde_entry *fde, bool eh_frame,
 	  && (!j
 	      || j->insn == DW_CFA_advance_loc
 	      || j->insn == DW_CFA_remember_state
+	      || j->insn == DW_CFA_GNU_window_save
 	      || j->insn == CFI_escape
 	      || j->insn == CFI_val_encoded_addr
 	      || j->insn == CFI_label))

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list