[PATCH 3/3] bfd: elf: add handling in bfd_section_from_shdr

Indu Bhagat indu.bhagat@oracle.com
Wed Jul 9 16:36:21 GMT 2025


On 7/9/25 7:13 AM, Jan Beulich wrote:
> On 07.07.2025 08:10, Indu Bhagat via Binutils wrote:
>> Although the default handling for (sh_type >= SHT_LOOS && sh_type <=
>> SHT_HIOS) is sufficient when SHT_GNU_SFRAME is in that range, it makes
>> sense to add it as a case of its own.
>>
>> As such, this change is not strictly necessary.
>>
>> TBD:
>>   - Do this or skip it ?  This is necessary to do only if the new
>>     section type is not SHT_LOOS/SHT_HIOS range.
> 
> I think it's better to have it like this. Question is why this isn't part
> of patch 2 (which otherwise looks okay to me).
> 

Just to ease out the review of this diff.  I will merge it into patch 2.

Thanks

> 
>> bfd/
>> 	* elf.c (bfd_section_from_shdr): Add case for SHT_GNU_SFRAME.
>> ---
>>   bfd/elf.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/bfd/elf.c b/bfd/elf.c
>> index 07b2d0e5a2d..05ff34a2b61 100644
>> --- a/bfd/elf.c
>> +++ b/bfd/elf.c
>> @@ -2476,6 +2476,7 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
>>       case SHT_PREINIT_ARRAY:	/* .preinit_array section.  */
>>       case SHT_GNU_LIBLIST:	/* .gnu.liblist section.  */
>>       case SHT_GNU_HASH:		/* .gnu.hash section.  */
>> +    case SHT_GNU_SFRAME:	/* .sframe section.  */
>>         ret = _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex);
>>         goto success;
>>   
> 



More information about the Binutils mailing list