From: Thomas Huth <thuth@redhat.com>
To: Sean Christopherson <seanjc@google.com>
Cc: "Laurent Vivier" <lvivier@redhat.com>,
linux-s390@vger.kernel.org, "Nico Böhr" <nrb@linux.ibm.com>,
"Janosch Frank" <frankja@linux.ibm.com>,
kvm@vger.kernel.org, "David Hildenbrand" <david@redhat.com>,
"Andrew Jones" <andrew.jones@linux.dev>,
kvmarm@lists.linux.dev, "Paolo Bonzini" <pbonzini@redhat.com>,
"Claudio Imbrenda" <imbrenda@linux.ibm.com>,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [kvm-unit-tests PATCH 2/2] Link with "-z noexecstack" to avoid warning from newer versions of ld
Date: Fri, 23 Jun 2023 18:03:23 +0200 [thread overview]
Message-ID: <fc70263c-b7af-d8e0-14f4-4ffcde67aa3e@redhat.com> (raw)
In-Reply-To: <ZJWrKtnflTrskPkX@google.com>
On 23/06/2023 16.24, Sean Christopherson wrote:
> On Fri, Jun 23, 2023, Thomas Huth wrote:
>> Newer versions of ld (from binutils 2.40) complain on s390x and x86:
>>
>> ld: warning: s390x/cpu.o: missing .note.GNU-stack section implies
>> executable stack
>> ld: NOTE: This behaviour is deprecated and will be removed in a
>> future version of the linker
>>
>> We can silence these warnings by using "-z noexecstack" for linking
>> (which should not have any real influence on the kvm-unit-tests since
>> the information from the ELF header is not used here anyway, so it's
>> just cosmetics).
>>
>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>> ---
>> Makefile | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/Makefile b/Makefile
>> index 0e5d85a1..20f7137c 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -96,7 +96,7 @@ CFLAGS += -Woverride-init -Wmissing-prototypes -Wstrict-prototypes
>>
>> autodepend-flags = -MMD -MF $(dir $*).$(notdir $*).d
>>
>> -LDFLAGS += -nostdlib
>> +LDFLAGS += -nostdlib -z noexecstack
>
> Drat, the pull request[1] I sent to Paolo yesterday only fixes x86[2].
Oops, sorry, I did not notice that patch in my overcrowded mailboxes (or
forgot about it during KVM forum...) :-/
> Paolo, want me to redo the pull request to drop the x86-specific patch?
I can also respin my patch on top of your series later ... the problem
currently also only seems to happen on x86 and s390x, on ppc64 and aarch64,
the linker does not complain ... so maybe it's even better to do it
per-architecture only anyway? Opinions?
Thomas
next prev parent reply other threads:[~2023-06-23 16:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-23 12:54 [kvm-unit-tests PATCH 0/2] Rework LDFLAGS and link with noexecstack Thomas Huth
2023-06-23 12:54 ` [kvm-unit-tests PATCH 1/2] Rework the common LDFLAGS to become more useful again Thomas Huth
2023-06-23 12:54 ` [kvm-unit-tests PATCH 2/2] Link with "-z noexecstack" to avoid warning from newer versions of ld Thomas Huth
2023-06-23 14:24 ` Sean Christopherson
2023-06-23 16:03 ` Thomas Huth [this message]
2023-06-26 22:34 ` Sean Christopherson
2023-08-14 10:15 ` Thomas Huth
2023-06-23 14:46 ` [kvm-unit-tests PATCH 0/2] Rework LDFLAGS and link with noexecstack Andrew Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fc70263c-b7af-d8e0-14f4-4ffcde67aa3e@redhat.com \
--to=thuth@redhat.com \
--cc=andrew.jones@linux.dev \
--cc=david@redhat.com \
--cc=frankja@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=linux-s390@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=lvivier@redhat.com \
--cc=nrb@linux.ibm.com \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).