From patchwork Tue Apr 16 15:23:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Usama Anjum X-Patchwork-Id: 13632068 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F5EEC04FF6 for ; Tue, 16 Apr 2024 15:23:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9DB0D6B0096; Tue, 16 Apr 2024 11:23:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 97D846B0099; Tue, 16 Apr 2024 11:23:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8464D6B009A; Tue, 16 Apr 2024 11:23:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 6582F6B0096 for ; Tue, 16 Apr 2024 11:23:20 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 23B83A0B02 for ; Tue, 16 Apr 2024 15:23:20 +0000 (UTC) X-FDA: 82015763760.13.E750110 Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) by imf04.hostedemail.com (Postfix) with ESMTP id 552B540018 for ; Tue, 16 Apr 2024 15:23:18 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=collabora.com header.s=mail header.b=BTfJMlxr; spf=pass (imf04.hostedemail.com: domain of usama.anjum@collabora.com designates 46.235.227.194 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass (policy=quarantine) header.from=collabora.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713280998; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=0GrXwwftpd9hkbMRnjrBcJ7ATLAPKFIUauVUHgdDAJA=; b=LJOo6PL3S9YaiCbXz60fOpW198o20YmMj+vtC6ckkM4itSN6EXt36iKmRt/SjoPW8KGFs0 QCnt05mCREv2UiWaFZnqk/Jz9oOQpEF27sqMlg8SwPKz/aRTyL8DG0FxjvcR/5G7RfDlnf gEuAxAAeT5msDHYkp8pk9I2Ntnl8Bas= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713280998; a=rsa-sha256; cv=none; b=AgYoHnk2LBTys/QHlNFB/g3M3O+/EoTQU0ECvOtfi1TArXvZXA7hFOwky8cJ2STYJINJsh j0RHGI7NigglJ8jTVLYzce9g/E5xrKeOdCu75u50fsPYjyYisV4Qu8ZFXueI68oB1lc/6H 5UJXaWWNUXeV3Iy3ImV7XzOTw6Y1Rtg= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=collabora.com header.s=mail header.b=BTfJMlxr; spf=pass (imf04.hostedemail.com: domain of usama.anjum@collabora.com designates 46.235.227.194 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass (policy=quarantine) header.from=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1713280996; bh=bLU73jHksihFb5Kkaq6O4l8bW9c2Gyah+VFZw8edoJs=; h=From:To:Cc:Subject:Date:From; b=BTfJMlxrRUDfa89Wuw0pdzkeWXI73KDxPeb0+H0wN5gDq9ooJz7F6f3QNHmFQuZai 2n1++yqBqRg95Xpi2EZcdFrPnWpKNLmSYBQ/62l3V7fgXZ6uILFDXJt8pG9A3vO7yX NXd3iasStbJAfwIn0vlx3uNQQ7u8EGDEEbdmN9rOPuYVVs22KSVUEkw9K2gUAhaumr SGULr/XhBI2hFFaedtgljvNBEKBQ3kc5dbMLfgCkb3MSxE04EoykkQKsOQzNGaUnPh DqQNnRVau+C72nJcOViHK4pXv+LgdJa+Qk+ifgG5wN2D7t+OqTwlMnhsfqZYeEAupK 0+hs2EjeWWGlg== Received: from localhost.localdomain (broslavsky.collaboradmins.com [68.183.210.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: usama.anjum) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 6248F37804B2; Tue, 16 Apr 2024 15:23:12 +0000 (UTC) From: Muhammad Usama Anjum To: Eric Biederman , Kees Cook , Shuah Khan , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Muhammad Usama Anjum , Yang Yingliang , Andrew Morton Cc: kernel@collabora.com, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH] selftests: exec: make binaries position independent Date: Tue, 16 Apr 2024 20:23:39 +0500 Message-Id: <20240416152341.3186853-1-usama.anjum@collabora.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 552B540018 X-Rspam-User: X-Stat-Signature: 67w1jautz7to4zg6ozjt974wbfgf3jyk X-HE-Tag: 1713280998-921703 X-HE-Meta: U2FsdGVkX1+2vuYpJxxkU36kGANloPY2o4l3nfFmm1iJQvhfHpcAhygfIP1pyLxVVw+sIJCGgyX6QK6sj4j4hr42CL1yQS4TGbKeWJ8V2G5AZRw3fFr2F3sGniWVq85Qf6fqjTUm721KDH4PIOhloo1/6sUFFBX0FxAbMZqpQS07iLrA9eLMbEBkojfRx+xW/XTwdx0KVSrlhMsTkiMBNX9Y/zzZxuCIzZuJWifIDj4d1SRUjgBlxxkTkDG/mc8nZ6QnETmRJ1zgQVSIPZvtGNQtPdIwtGTYs0p2X41eWp+mnK6Ah+Mvv9KwnAFfoZItgnr1Y6Re7e+cAJkqnGSXMachkVCbJ6Ec1oCen1jP7NLbgGxdfKgldaQxFccmx0VzO9GXzUnFd1c0sVVL0WvTf8hg9zrKc7n/yUofKzTWZxNq553g0ACtVX5PAw+GeHPuHvDZAQTo2sidv50QxKnQj7SSlEYu0wG8rC97LGWH9ob6CdMMl/ViBFXdvn5DuLPSu00mQ8hpRMrHCa2cAP5j6ecZy7q2mdcnoLtKW7TsiQO38eFGcWRWW/UGQbETwoFRq6JZRpw0XnhK+f9vLw0LgNohK/V5HhgI7sjSkuM16Jyc1AnBi3A/RYdCEqWKdyHyj5NESVvCuDDpuuhT1nwyCCszNYyCGoxAyEOFtb3pp3azD+Z8Jenx2saj9nYGRHNkss/MF6jmMhQEZN6rk2iz4NKsxjXZNErjiLRoTpu1GZhi0pmUD2Kmntjhi46x7YdtP2BtYBHUY061mAMa08GG/mcD+2+xV8OKOb88UhZfmvJ3nf1btB6wfp05npJse1Le6n2JBMfnKiwHsnAaNvLmYk1YnWUaqE7fCGAx81zyIh3bWEBTpyGGJhB0ZcpruP+2ICZJ15FJJH0Nzp+UScZY3uhnpGClRYV3koSOJ3fpZ5v1udCuumbg7OiDLMNFX+oQxcv7FhdvsEsCGIbtbCZ 4UOMKxQO e5Je8cLu8G9KCOxFWWPu8FwyBocLFT8nuc9jbNsTtYe1jQPB6zLdt+1OP7sTElIbAlrfqOeJ3bNDFfV8UpngUQedUkTE97i3SssIRqw9OwX9VNCjKPcBvumCgW1yL2q2WY99Gkyx+dpf0pA4vowcLQzBPwlxnyN/YpzAkvT8iyCpDSw/279e7KbCS74WLH+2GSXqZR4lpN8ED7DPs3Soyq3Av2azz9F0d8bHxHw/8HhGlo6eREi5/KIG6GHDM35+vE93V X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: The -static overrides the -pie and binaries aren't position independent anymore. Use -static-pie instead which would produce a static and position independent binary. This has been caught by clang's warnings: clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument] Tested with both gcc and clang after this change. Fixes: 4d1cd3b2c5c1 ("tools/testing/selftests/exec: fix link error") Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/exec/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/exec/Makefile b/tools/testing/selftests/exec/Makefile index fb4472ddffd81..01940d9165d67 100644 --- a/tools/testing/selftests/exec/Makefile +++ b/tools/testing/selftests/exec/Makefile @@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS = -Wall +CFLAGS = -Wall #-Wunused-command-line-argument CFLAGS += -Wno-nonnull CFLAGS += -D_GNU_SOURCE @@ -29,8 +29,8 @@ $(OUTPUT)/execveat.denatured: $(OUTPUT)/execveat cp $< $@ chmod -x $@ $(OUTPUT)/load_address_4096: load_address.c - $(CC) $(CFLAGS) $(LDFLAGS) -Wl,-z,max-page-size=0x1000 -pie -static $< -o $@ + $(CC) $(CFLAGS) $(LDFLAGS) -Wl,-z,max-page-size=0x1000 -static-pie $< -o $@ $(OUTPUT)/load_address_2097152: load_address.c - $(CC) $(CFLAGS) $(LDFLAGS) -Wl,-z,max-page-size=0x200000 -pie -static $< -o $@ + $(CC) $(CFLAGS) $(LDFLAGS) -Wl,-z,max-page-size=0x200000 -static-pie $< -o $@ $(OUTPUT)/load_address_16777216: load_address.c - $(CC) $(CFLAGS) $(LDFLAGS) -Wl,-z,max-page-size=0x1000000 -pie -static $< -o $@ + $(CC) $(CFLAGS) $(LDFLAGS) -Wl,-z,max-page-size=0x1000000 -static-pie $< -o $@