[PATCH] gas: sframe: Error on open CFI at EOF; missing .cfi_endproc

Jens Remus jremus@linux.ibm.com
Thu Apr 30 10:21:45 GMT 2026


On 4/30/2026 9:07 AM, Alan Modra wrote:
> On Mon, Apr 13, 2026 at 04:42:25PM +0200, Jens Remus wrote:
>> Open CFI at end of file (i.e. .cfi_startproc without matching
>> .cfi_endproc) caused generation of SFrame strack trace information
>> to segfault.
>>
>> Handle an open DWARF FDE in .sframe generation like it is handled
>> in .eh_frame and .debug_frame generation (see cfi_finish() in
>> gas/dw2gencfi.c).  Report the following error and set the DWARF FDE
>> end address to its start address:
>>
>>   open CFI at the end of file; missing .cfi_endproc directive
>>
>> gas/
>> 	PR/gas 34026
>> 	* gen-sframe.c (create_sframe_all): Error on open CFI.
>>
>> gas/testsuite/
>> 	PR/gas 34026
>> 	* gas/cfi-sframe/cfi-sframe.exp: Run new test.
>> 	* gas/cfi-sframe/cfi-sframe-common-pr34026.d: New test.
>> 	* gas/cfi-sframe/cfi-sframe-common-pr34026.s: Likewise.
>>
>> Signed-off-by: Jens Remus <jremus@linux.ibm.com>
> 
> I was leaving this for Indu to approve, but since that hasn't happened
> I'll approve it.

Thanks!  Committed to mainline.  Note that I took the freedom to improve
the added test name:

>> diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-pr34026.d b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-pr34026.d

>> +#as: --gsframe
>> +#error: open CFI at the end of file; missing \.cfi_endproc directive
>> +#name: Open CFI (PR 34026)
#name: Open CFI at end of file (PR 34026)

Regards,
Jens
-- 
Jens Remus
Linux on Z Development (D3303)
jremus@de.ibm.com / jremus@linux.ibm.com

IBM Deutschland Research & Development GmbH; Vorsitzender des Aufsichtsrats: Wolfgang Wendt; Geschäftsführung: David Faller; Sitz der Gesellschaft: Ehningen; Registergericht: Amtsgericht Stuttgart, HRB 243294
IBM Data Privacy Statement: https://www.ibm.com/privacy/



More information about the Binutils mailing list