[RFC] Disabling -z execstack per emulation

Michal Lach michal.lach@phoenix-rtos.com
Mon Mar 30 11:06:48 GMT 2026


Jan Beulich <jbeulich@suse.com> writes:

Resending with binutils@ CC, sorry, did not reply-all.

> On 27.03.2026 18:04, Michal Lach wrote:
>> Hi,
>>
>> I was wondering about having an emulation parameter for elf.am
>> based emulations to disable usage of -z execstack.
>>
>> The rationale is that there are systems that do not allow for creation
>> of executable stack mappings, such as OpenBSD,
>
> And that also never was possible there?

It was, 24 years ago, from 1.19 executable stacks are disabled by
default IIUC.

>> on which warnings about
>> executable stacks will appear regardless; that is a bit misleading.
>>
>> I'd like to ask for any thoughts on the matter described.
>>
>> I'm attaching a patch with a draft of how I have this implemented
>> right now.
>
> That isn't quite enough, is it? You would also want to suppress ELF
> note generation as well as recognition, I guess. Diagnostics emitted
> when finding an execstack note (from an old or "foreign" toolchain)
> may also want to have alternative wording there.

This would have to be paired with disabling execstack warnings
per-target in configure.tgt scripts, but it is already possible,
unlike what I described.

--
 - Michal Lach


More information about the Binutils mailing list