[PATCH] gas: sframe: partially process DWARF expressions in CFI_escape
Jens Remus
jremus@linux.ibm.com
Mon Feb 3 10:23:36 GMT 2025
On 01.02.2025 02:15, Indu Bhagat wrote:
> On 1/29/25 9:11 AM, Jens Remus wrote:
>> On 28.01.2025 01:57, Indu Bhagat wrote:
>>> CFI_escape is most commonly used to include DWARF expressions in the
>>> unwind information. One may also use CFI_escape to add OS-specific CFI
>>> opcodes. Up until now, SFrame generation process would skip generating
>>> SFrame FDE at the mere sight of a CFI_escape opcode.
>>>
>>> Fine tune the handling of CFI_escape for SFrame generation by explicitly
>>> checking for some "harmless" (in context of SFrame generation)
>>> CFI_escape DWARF expressions:
>>> - DW_CFA_expression affecting non SP/FP registers
>>> - DW_CFA_value_expression affecting non SP/FP registers.
>>
>> Could that be extended to also process the CFI instructions already
>> supported by SFrame, such as e.g. DW_CFA_val_offset through
>> sframe_xlate_do_val_offset()?
>>
>
> We could invoke sframe_xlate_do_val_offset (), we will just have to craft a new struct cfi_insn_data object just for checking the register...
>
> What is the opinion on copying the necessary conditional into sframe_xlate_do_expr () for DW_CFA_val_offset ?
You mean duplicating the sframe_xlate_do_val_offset() logic into
sframe_xlate_do_expr()? I would not object. Though I thought maybe
all existing sframe_xlate_do_*() could be covered, although it probably
only makes sense to take care of those where there are known use cases,
such as sframe_xlate_do_val_offset().
>> On s390 Glibc for instance uses .cfi_escape to piece together
>> .cfi_val_offset due to minimum binutils release requirements.
Regards,
Jens
--
Jens Remus
Linux on Z Development (D3303)
+49-7031-16-1128 Office
jremus@de.ibm.com
IBM
IBM Deutschland Research & Development GmbH; Vorsitzender des Aufsichtsrats: Wolfgang Wendt; Geschäftsführung: David Faller; Sitz der Gesellschaft: Böblingen; Registergericht: Amtsgericht Stuttgart, HRB 243294
IBM Data Privacy Statement: https://www.ibm.com/privacy/
More information about the Binutils
mailing list