[PATCH 02/12] include: libsframe: add APIs for SFrame header flags

Indu Bhagat indu.bhagat@oracle.com
Thu May 29 16:34:53 GMT 2025
On 5/28/25 1:32 AM, Jens Remus wrote:
> On 28.05.2025 07:40, Indu Bhagat via Binutils wrote:
>> Add new APIs, one each for getting flags from the SFrame decoder and
>> SFrame encoder context objects respectively.
>>
>> These will later be used by the linker to uniformly access the flags,
>> given the SFrame decoder and SFrame encoder objects.
>>
>> Use the new API, where applicable, within libsframe.
> 
>> diff --git a/include/sframe-api.h b/include/sframe-api.h
> 
>> @@ -124,6 +124,10 @@ sframe_decoder_get_abi_arch (sframe_decoder_ctx *dctx);
>>   extern uint8_t
>>   sframe_decoder_get_version (sframe_decoder_ctx *dctx);
>>   
>> +/* Get the flags from the SFrame decoder context DCTX.  */
> 
> The comments on the function declaration and definition do not match.
> 

Hi Jens,

Thanks for reviewing.

Fixed. Changed to:
+/* Get the section flags from the SFrame decoder context DCTX.  */

>> +extern uint8_t
>> +sframe_decoder_get_flags (sframe_decoder_ctx *dctx);
> 
> Rename to sframe_decoder_get_{section|header}_flags, as it does not
> return the SFrame decoder flags, but the SFrame section/header flags?
> 

We have other APIs of similar nature which get data from SFrame 
header/preamble but with no section|header in the names, e.g., 
sframe_decoder_get_version, sframe_decoder_abi_arch.

I tried to keep the style similar.

>> +
>>   /* Return the number of function descriptor entries in the SFrame decoder
>>      DCTX.  */
>>   extern uint32_t
>> @@ -238,6 +242,10 @@ sframe_encoder_get_abi_arch (sframe_encoder_ctx *encoder);
>>   extern uint8_t
>>   sframe_encoder_get_version (sframe_encoder_ctx *encoder);
>>   
>> +/* Get the flags from the SFrame decoder context DCTX.  */
>> +extern uint8_t
>> +sframe_encoder_get_flags (sframe_encoder_ctx *encoder);
> 
> Same as above (comment and function name).
> 

Fixed. Changed to:
+/* Get the section flags from the SFrame encoder context ENCODER.  */

>> +
>>   /* Return the number of function descriptor entries in the SFrame encoder
>>      ENCODER.  */
>>   extern uint32_t
> 
> Regards,
> Jens



More information about the Binutils mailing list