[PATCH,V2] objdump: sframe: fix multiple emission of SFrame and DWARF Frame
Jens Remus
jremus@linux.ibm.com
Fri Feb 6 09:41:13 GMT 2026
On 2/6/2026 8:49 AM, Jan Beulich wrote:
> On 06.02.2026 08:40, Indu Bhagat wrote:
>> Currently, when a user specifies both -WF (to dump DWARF Frame) and
>> --sframe, the dump_dwarf () call is triggered twice,
>>
>> First, in dump_bfd ():
>> if (dump_dwarf_section_info)
>> dump_dwarf (abfd, is_mainfile);
>>
>> And then again in dump_bfd () via:
>> if (dump_sframe_section_info)
>> dump_sframe_section (abfd, dump_sframe_section_name, is_mainfile);
>> Where dump_sframe_section () itself invokes dump_dwarf () to emit SFrame
>> section.
>>
>> The original intent of making dump_sframe_section () to invoke
>> dump_dwarf () was to reuse the existing (DWARF) machinery for relocation
>> and emission of SFrame section (along with DWARF sections). But this
>> may cause duplicate emission as noted above (PR 33806).
>>
>> So, carve out the necessary work into dump_sframe_section () to make it
>> not invoke dump_dwarf (): explicitly load the SFrame section and then
>> invoke the associated display function directly. This ensures that the
>> SFrame textual dump is emitted exactly once as intended.
>>
>> Additionally, this patch removes:
>> - the temporary "sframe-internal-only" debug option because it not
>> needed anymore, now that we dont use dump_dwarf () for SFrame dumping
>> anymore.
>> - stubs from dump_dwarf_section () specific to SFrame, as it is not
>> called for it anymore.
>>
>> While at it, xstrdup consistently and free the dump_sframe_section_name
>> var.
>>
>> Update the existing sframe-func.s to ensure .eh_frame section is emitted
>> as well. Add new test objdump-sframe-2.d to verify that textual dump
>> using objdump contains single textual dumps of .eh_frame and .sframe (if
>> both --sframe and -WF are specified).
>>
>> PR libsframe/33806
>>
>> binutils/
>> PR libsframe/33806
>> * dwarf.c (debug_option_table): Remove sframe-internal-only.
>> * objdump.c (dump_sframe_section): Call display function
>> directly instead of dump_dwarf.
>> (dump_bfd): Update call to dump_sframe_section.
>> (main): Remove 'sframe-internal-only' hack.
>> binutils/testsuite/
>> * binutils-all/x86-64/sframe-func.s: Emit .eh_frame section as
>> well.
>> * binutils-all/x86-64/objdump-sframe-2.d: New test.
>
> Okay, provided Jens indicates his concerns were also addressed.
Ok from my side. Although I am not convinced that omitting the explicit
free_debug_section (sframe) is cleaner or important for performance.
But let's not start bikeshedding.
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