[PATCH v3 1/3] include: libsframe: Add API to get total number of FREs

Jens Remus jremus@linux.ibm.com
Wed Jul 23 14:33:55 GMT 2025


On 23.07.2025 15:42, Jan Beulich wrote:
> On 23.07.2025 15:17, Jens Remus wrote:
>> This API will be later used by the linker to handle the special case
>> of a SFrame section that solely contain FDEs without any FREs.  Such
>> FDEs without any FREs will be used to represent RA undefined.

>> diff --git a/libsframe/sframe.c b/libsframe/sframe.c

>> @@ -1499,6 +1499,20 @@ sframe_encoder_get_num_fidx (sframe_encoder_ctx *encoder)
>>    return num_fdes;
>>  }
>>  
>> +/* Return the number of function row entries in the SFrame encoder
>> +   ENCODER.  */
>> +
>> +uint32_t
>> +sframe_encoder_get_num_fres (sframe_encoder_ctx *encoder)
>> +{
>> +  uint32_t num_fres = 0;
>> +  sframe_header *ehp = NULL;
> 
> Just one nit: What's the point of this initializer? Why can't ...

Doh!  The result of thoughtless copy and paste and minor adaption of
sframe_encoder_get_num_fidx's code.

>> +  ehp = sframe_encoder_get_header (encoder);
> 
> ... this be the initializer right away?

Makes absolutely sense!  I'll take that into account, unless Indu does
prefer to omit this new API and let libsframe use ehp->sfh_num_fres
directly.  The latter could make sense as this new API would only be
used internally by libsframe.

>> +  if (ehp)
>> +    num_fres = ehp->sfh_num_fres;
>> +  return num_fres;
>> +}

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