https://sourceware.org/bugzilla/show_bug.cgi?id=34026
Jens Remus <jremus at linux dot ibm.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jremus at linux dot ibm.com
--- Comment #1 from Jens Remus <jremus at linux dot ibm.com> ---
This is caused by the open CFI at end of file:
$ cat pr34026-sframe.s
.cfi_sections .sframe
.cfi_startproc
$ ./as-new pr34026-sframe.s
pr34026-sframe.s: Assembler messages:
pr34026-sframe.s: Internal error (Segmentation fault).
Please report this bug.
$ cat pr34026-eh_frame.s
.cfi_sections .eh_frame
.cfi_startproc
$ ./as-new pr34026-eh_frame.s
pr34026-eh_frame.s: Assembler messages:
pr34026-eh_frame.s: Error: open CFI at the end of file; missing .cfi_endproc
directive
One of the following would resolve it:
Option A: Handle this in create_sframe_all()
diff --git a/gas/gen-sframe.c b/gas/gen-sframe.c
--- a/gas/gen-sframe.c
+++ b/gas/gen-sframe.c
@@ -2478,6 +2478,14 @@ create_sframe_all (void)
/* Initialize the translation context with information anew. */
sframe_xlate_ctx_init (xlate_ctx);
+ /* Report and fix open CFI. */
+ if (dw_fde->end_address == NULL)
+ {
+ as_bad (_("open CFI at the end of file; "
+ "missing .cfi_endproc directive"));
+ dw_fde->end_address = dw_fde->start_address;
+ }
+
/* Process and link SFrame FDEs if no error. */
int err = sframe_do_fde (xlate_ctx, dw_fde);
Option B: Handle this in cfi_finish() like it is done for .eh_frame and
.debug_frame
diff --git a/gas/dw2gencfi.c b/gas/dw2gencfi.c
--- a/gas/dw2gencfi.c
+++ b/gas/dw2gencfi.c
@@ -2611,6 +2611,16 @@ cfi_finish (void)
segT sframe_seg;
int alignment = ffs (DWARF2_ADDR_SIZE (stdoutput)) - 1;
+ for (fde = all_fde_data; fde ; fde = fde->next)
+ {
+ if (fde->end_address == NULL)
+ {
+ as_bad (_("open CFI at the end of file; "
+ "missing .cfi_endproc directive"));
+ fde->end_address = fde->start_address;
+ }
+ }
+
sframe_seg = get_cfi_seg (NULL, ".sframe",
(SEC_ALLOC | SEC_LOAD | SEC_DATA
| DWARF2_EH_FRAME_READ_ONLY),
--
You are receiving this mail because:
You are on the CC list for the bug.