[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] build/x86: suppress GNU ld 2.39 warning about RWX load segments


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 11 Aug 2022 14:12:57 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=htI3QdfpY1q136MRu9rJ1V3L6ZgoTZTIELuLwA7EY14=; b=I6LOz6a146Lj/HqaqN0TjNMuBQDDSoNEBzyNcuwoRUrKi4H6F0HnhLq5qKpsp6NqnATy8sUDnYOgj8maevGBh261PMOP5i6VoFrrJ7Zgu8nn3AgrUYSOCEE5ZDb/8LJXT7SRL3L5dBw8+ixu/H0PvXA2w/2/UqrENWddJm+FryVf9VTbND40Sar6TLMBVSOAnCt46h+PaC75f87c/ERyRBI0Wp0OahJ6iALWWRx754G7LmFHdFWwuPmxnzTbXuFd0LhwZZ407+syT30I7RO+5+7vlmB+i8/sijHQ5mYm57d0EXoBxVIjYLwMdxo3I8TCBmUXMBjtbaclo78a8P2N8A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=njAWftEpHUuO8oh7JK0ep3Z54qBl8nNgPNQ5sXjQeILzdjkOicqckV3tTr4Q1l3nC4ZSKrXXQAbSz+UtNSaIVuFqsofnA/7VXOaWs4ZaTjaPiiLqPAkxOuUh4TTnPZbtVULozNJTvxy8t1AZonQjCbHTex/UMd3HPjg4poVtwLb6Yf9bM0mVJfAZq60cz9ZNs/RnS01bQVzOOKWrIJc4Nm3bOwul5eoTjl7houwwXr3j7RVkkIM9eCXFmWTo+ZKPmgNBJBVezSN7Mm4QFSy5YBarxQyRuyUDJIVaz2q4ycKlUBGpWCJ1P2n+AWU4fR1lD6NcVx3BAVeFcP0Ki9pHtA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Thu, 11 Aug 2022 12:13:08 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Commit 68f5aac012b9 ("build: suppress future GNU ld warning about RWX
load segments") didn't quite cover all the cases: Apparently I missed
ones in the building of 32-bit helper objects because of only looking at
incremental builds (where those wouldn't normally be re-built). Clone
the workaround there to the specific Makefile in question.

Reported-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
Because of the use of LDFLAGS_DIRECT (coming directly from the Config.mk
helpers in config/) having a central place to set this once isn't very
easy: An option might be to introduce XEN_LDFLAGS_DIRECT and export that
from where the other XEN_*FLAGS are also exported. The way it's done
here is the less intrusive variant, though.

--- a/xen/arch/x86/boot/Makefile
+++ b/xen/arch/x86/boot/Makefile
@@ -24,6 +24,9 @@ CFLAGS_x86_32 += -I$(srctree)/include
 $(head-srcs:.S=.o): CFLAGS_stack_boundary :=
 $(head-srcs:.S=.o): XEN_CFLAGS := $(CFLAGS_x86_32) -fpic
 
+LDFLAGS_DIRECT-$(call ld-option,--warn-rwx-segments) := --no-warn-rwx-segments
+LDFLAGS_DIRECT += $(LDFLAGS_DIRECT-y)
+
 $(head-srcs): %.S: %.bin
        (od -v -t x $< | tr -s ' ' | awk 'NR > 1 {print s} {s=$$0}' | \
        sed 's/ /,0x/g' | sed 's/,0x$$//' | sed 's/^[0-9]*,/ .long /') >$@



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.