[V3 18/36] [SFrame-V3] gas: sframe: output new FDE type SFRAME_FDE_TYPE_FLEX

Indu Bhagat indu.bhagat@oracle.com
Wed Jan 14 06:34:33 GMT 2026


On 1/13/26 4:28 AM, Jens Remus wrote:
> On 1/13/2026 12:12 PM, Indu Bhagat wrote:
>> This patch updates the routines for emission of the new FDE type
>> SFRAME_FDE_TYPE_FLEX in the SFrame output section.  The support for
>> generating these flex FDEs themselves is added in a subsequent commit.
>>
>> Update struct sframe_row_entry to track additional state for CFA,
>> FP, and RA.  Modify output_sframe_row_entry_offsets () to emit
>> metadata/offset pairs for flexible FDEs or padding where applicable,
>> ensuring the usual ordering (CFA, RA, FP).  The padding data, a.k.a.
>> SFRAME_FRE_RA_OFFSET_INVALID is emitted in flexible FDEs when RA is
>> untracked but FP offsets follow.  Trailing padding offsets should not
>> occur.  Add a new function get_udata_size_in_bytes () to account for
>> sizing of unsigned register metadata.
>> diff --git a/gas/gen-sframe.c b/gas/gen-sframe.c
> 
>> @@ -420,6 +454,38 @@ sframe_get_fre_offset_size (const struct sframe_row_entry *sframe_fre)
>>     if (ra_offset_size > max_offset_size)
>>       max_offset_size = ra_offset_size;
>>   
>> +  /* If flex FDE, account for reg data too.  */
>> +  if (flex_p)
>> +    {
>> +      bool reg_p = (sframe_fre->cfa_base_reg != SFRAME_FRE_REG_INVALID);
>> +      unsigned int data
>> +	= SFRAME_V3_FLEX_FDE_REG_ENCODE (sframe_fre->cfa_base_reg,
>> +					 sframe_fre->cfa_deref_p, reg_p);
>> +      unsigned int data_size = get_udata_size_in_bytes (data);
>> +      if (data_size > max_offset_size)
>> +	max_offset_size = data_size;
>> +
>> +      if (sframe_fre->ra_loc != SFRAME_FRE_ELEM_LOC_NONE)
>> +	{
>> +	  reg_p = (sframe_fre->ra_loc != SFRAME_FRE_ELEM_LOC_REG);
> Mustn't that be as follows (like it is done for FP below)?
> 
> 	  reg_p = (sframe_fre->ra_loc == SFRAME_FRE_ELEM_LOC_REG);

Yes.  Fixed, thanks.



More information about the Binutils mailing list