[PATCH] elf: Don't set .note.GNU-stack type to SHT_NOTE

Jan Beulich jbeulich@suse.com
Mon Jan 12 08:40:36 GMT 2026


On 10.01.2026 10:35, H.J. Lu wrote:
> On Sat, Jan 10, 2026, 5:28 PM Jan Beulich <jbeulich@suse.com> wrote:
> 
>> On 10.01.2026 04:50, H.J. Lu wrote:
>>> .note.GNU-stack section doesn't conform to SHT_NOTE spec:
>>>
>>> https://gabi.xinuos.com/v42/elf/07-pheader.html#note-sections
>>>
>>> since it is an empty section with the corresponding fields.  It maps to
>>> PT_GNU_STACK segment, not PT_NOTE segment.  It is inappropriate to set
>>> its type to SHT_NOTE.
>>
>> Then it's also inappropriate to name it .note.*, as that way it will be
>> covered by .note.* as commonly used
> 
> This was an overnight when it was introduced.

Well, and now everyone has to deal with it specially?

> On the other hand, linker should check
> section type, not section name, except
> for special sections.

I fear I don't understand this. There's no type specification possible in
linker scripts, is there?

Jan

> in linker scripts. I really wonder why
>> no-one has cared to respond to the patch when it was still uncommitted ...
>>
>> Jan
>>
>>
> 



More information about the Binutils mailing list