This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH, GOLD, AArch64] default stack not executable
On Thu, Sep 21, 2017 at 6:31 PM, Alan Modra <amodra@gmail.com> wrote:
> On Thu, Sep 21, 2017 at 05:56:51PM -0700, Jim Wilson wrote:
>> On Thu, Sep 21, 2017 at 5:26 PM, Cary Coutant <ccoutant@gmail.com> wrote:
>> > I don't see why aarch64 should be treated differently from other
>> > targets here, unless you can claim that there is no such thing as an
>> > old object that requires an executable stack but does not contain a
>> > stack note to that effect. If that's the case for aarch64 (and Han
>> > agrees), I'll support this patch.
>>
>> GNU-stack notes were added in 2004. The aarch64 port was added in
>> 2012. So yes, there are no old object files that predate the
>> GNU-stack notes, which is why aarch64 ld.bfd ignores a missing
>> GNU-stack note.
>>
>> > Since you raise the possibility that ppc should also default to false,
>> > I'll ask Alan the same question: are there old objects that must be
>> > assumed to require an executable stack?
>>
>> That should be 64-bit ppc only. 32-bit ppc has old object files that
>> we need to be compatible with. Though I'm not sure what the
>> justification is for 64-bit ppc, since it did exist before GNU-stack
>> notes. Maybe this is because of the new ABI that rolled out a few of
>> years ago? Checking ChangeLogs, I see that execstack was turned off
>> for 64-bit ppc in 2007.
>
> ppc64 ELFv1 never needs to be exec stack. Since function descriptors
> are used there is no need for stack trampolines. Current gcc doesn't
> emit the stack notes for ELFv1.
>
> ppc64 ELFv2 on the other hand *does* need stack trampolines, and gcc
> has always emitted the stack notes for ELFv2.
>
> So I think is_default_stack_executable should indeed be false for
> ppc64.
OK, I'm satisfied for both aarch64 and ppc64. Jim, your patch is OK.
Alan, I'll leave the ppc64 patch to you.
Any thoughts on turning on --warn-execstack by default?
-cary