Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp47970lqb; Tue, 16 Apr 2024 08:28:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX9pV0pRSGFo3/bTjsEWdyIk1KWvhk0844ZsYGqKrn4IPsvgtleVajuh4JjsYGk7DyZ/B8dwojZ9ObxjYCwvXGqGVJzE5Tub4nuB3Ds9A== X-Google-Smtp-Source: AGHT+IFyFidykJFU9OZeN3ly1Z72pn64LFluh1NUzVw8TEV9k/GNOosdfgaxXPnr48aHZSHH69Pu X-Received: by 2002:ac2:4254:0:b0:515:d13a:d1ec with SMTP id m20-20020ac24254000000b00515d13ad1ecmr9219650lfl.27.1713281299392; Tue, 16 Apr 2024 08:28:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713281299; cv=pass; d=google.com; s=arc-20160816; b=wH+Epd62HhWZ0fUJFRY/AjGxc82mlXLyNecdjeqg2P2pcWI2qvniKF7zIUEHFXSjaW DbkG7U4wxafVSZxI9jxlwqItzNxhsQPA17u5rO5R+01eQfdsfTLpECPsTVVz6RFCSbba LE5pLSHO8hCUDKr5wv97Gndpv8KLcrPEu08NkVOdHLtSt5CGbpydQ0nqiGVlJnZ8lBN3 Zo8M98ltOWWgrCg8m99oQgnQkWuVnszzD+AomS1AP1j09ClyVRMRE/FY15wQlOD4Y2u+ CXzKHf6BeL2WcyuM/AIB3cQ0qjh6GSo6W+ozSc3/FdW+d8KFHdFySHVU9H1tbMDlZoR+ J+yA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=qF6p1YPdfboNLsIrMgn/7HauXXlP04nm6WbKlQhhMqY=; fh=brXgMs6Fw67qBD8m91WxRQ6mzhNCb8v2rUUfN1L1mrc=; b=OwiSyMEL+RPAxRykqtz2DDyt462vKvWuZOMKUIB+Hf1CZ0qn+5CwtPu1R00jwnS+LD Xo6JnZLUVA6QXoI9/mwFUTnlAegtQ7ifims5kYf1/HO8H704792mDxlcZjOn/sPXoAI9 MphJqjlxR79HHvq1TUgNEPky1QFxTvH6G2Lc5JpSi5fC6NZus8k674DgA83P9cWTuKaJ BFr/t/mWJ/ZpqpddUo+QxPSO5bwiSWG/O3t1nOLuPUmAOh7MRCfRPKbSowJJtRh7RH8d zsxfpV7sKlIfTKBibSMKCm5ERHTwiAjQaA9mkVtu6rDKhPbPaxZ1Rz5aHpUulMfCA34j hFFg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=q5ie51gk; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-147125-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147125-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id i27-20020a0564020f1b00b005701dd9f16dsi3159803eda.343.2024.04.16.08.28.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 08:28:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-147125-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=q5ie51gk; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-147125-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147125-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 01FCA1F22149 for ; Tue, 16 Apr 2024 15:28:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1F572130E2C; Tue, 16 Apr 2024 15:28:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="q5ie51gk" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F0B5130AC3; Tue, 16 Apr 2024 15:28:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713281293; cv=none; b=p+e7MuREy9qy5CpONC9GC5jADqTjYcuWEY+7CjOFgJH6q8Ghn5xyxF6c20hd1FUFToolkUmg//SertpBPfykTiqH+BVsRTLxkugrmmDEFqxppMw4qRALl3q6kj3vuxASQ9RyrKvrngelhn5H/03Idc8CyjBkO2VdpnQ6VtIKxRk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713281293; c=relaxed/simple; bh=NGtY+NfH5eSYN/zT1SdxCb+w6K6ZM2eMh40eWe83mAw=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=UeOjExUZr1VyALm6iAmEvPbL/sguWk/x+fY3dqQ5OLuDeHrjVoN9ITUc6lI3WSNNDMOU6XCPnamf4LCWF1IFPJbv730KzCfbNpbFe+CE4qg3FvmqYA2mElPA0b9VYPYk+QkE/XVzc4fJ7tuvxBAQ2Dd6clFQ/gaH8oXA4XY3W4U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=q5ie51gk; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1713281290; bh=NGtY+NfH5eSYN/zT1SdxCb+w6K6ZM2eMh40eWe83mAw=; h=From:To:Cc:Subject:Date:From; b=q5ie51gkGiYUIkIH7VFgHFaGbHNjJNJ4bmSL6eUqT6OilkJU0r80xLkLOQ+sgdSV0 bwIQNhl/g6vndbJtGrPydob0tNnkA6xAM+8ACZBUs5mMSG8yaQV95MIjCBLOIkR2gg I/9NAhQzY+7q7rPZFUWjTlggR6pWcc98f+TN+0wZLphdL6WXtrt1zCZVeugwK1qOxc 3Xpae/6sqP1L8jRvh5so3zjTJ485iyp9ij+YUZ+gXP3SuxfjGRCfFMXB5SklzTKl3M GNBjmU4IlCAcr7USdFHByfH9ALNfEMvvs/KD3ajrd16vPRwg362veCUjo1c8wJbjld KqR92gMgfFgsQ== 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 B359B37804B2; Tue, 16 Apr 2024 15:28:03 +0000 (UTC) From: Muhammad Usama Anjum To: Eric Biederman , Kees Cook , Shuah Khan , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Muhammad Usama Anjum , Andrew Morton , Yang Yingliang Cc: kernel@collabora.com, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH v2] selftests: exec: make binaries position independent Date: Tue, 16 Apr 2024 20:28:29 +0500 Message-Id: <20240416152831.3199999-1-usama.anjum@collabora.com> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- Changes since v1: - Remove unneeded comment --- tools/testing/selftests/exec/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/exec/Makefile b/tools/testing/selftests/exec/Makefile index fb4472ddffd81..3c79ec9bf780f 100644 --- a/tools/testing/selftests/exec/Makefile +++ b/tools/testing/selftests/exec/Makefile @@ -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 $@ -- 2.39.2