From nobody Sat Oct 11 08:30:48 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 377B425394C for ; Wed, 11 Jun 2025 09:22:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749633747; cv=none; b=F9qyxdrNQZlJbFNbiPi2RltmP683IR4mYJ6t4raetThdNf1tMlqNfeR1orCaTpV6S3nTJZL4flxubOQ7SRItR2SPiX+cMAkV5W5GkQbbN+Yu7DwWtFH8gHoA7dpDv/HEzNFI3ItMCMKRGwV7+GjI9Pa2J8OW4XOeQOYY4rvsXsE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749633747; c=relaxed/simple; bh=OzIhnUie/Ctxfm+QEMkyUANhfsCLwQddvZkNgATaxKY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TYFrwO68G0T7KIUkFwe0bHweRuWAI9AjmyaQoCeODvwcuN40hRXKnB/4iKmPxishFFXxCABY91VZvrrPEBt7cDMCFIWJ+IDkSXerhhoB1t4KvvP0Q2NvF3BOFBFCylqxA1GyhqT/P+YG4FiHuwvVYvdKKs6r+xjHsBBiOKwaX1w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=ozsJbD3Z; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=zQIT3kbf; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ozsJbD3Z"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="zQIT3kbf" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1749633744; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3HNZsp0JlEkXQwt3qtPmvEy68Xqh0vFAuSqvlPQb0tk=; b=ozsJbD3ZX1b1TkGONklwnRC0Ny/GSAJX3OYVI2fzjIY09e9Qll0amtsZ9Xjm8U1SjSQy7I gOKqJ/zoKv4EjJgrFsJQ64y4n256ijE1hDSKDqxEXZmbAXTVU/pUt4TNXWew1aJ3p155IN /9Xl5Qmo6F2LcYDF2fI5w+3WzRpOYDCKlbmjaC4Lhrl3FuZMbTuXGuftDMJR6DIl0ErsuC Fg0HI3rpR37M1bhnLWifsYAguK2vPpQGZ94K93n7e7gCTA4xbgVoREGrzONkF0ZoNAAsJZ qIzSYy4j6l6mf06OI6YpzYD+4o23q/yN5V0mrupshSzA9a109J3BDcwUfZzznA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1749633744; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3HNZsp0JlEkXQwt3qtPmvEy68Xqh0vFAuSqvlPQb0tk=; b=zQIT3kbfh9XJgCN+qaxlUHW7+ex3ON7H/WPvvQYs1eD7SwosJIekGb6djwQYLbfgUwzAou RM9OkwLNLwiFfuBg== Date: Wed, 11 Jun 2025 11:22:12 +0200 Subject: [PATCH v3 1/3] riscv: vdso: Deduplicate CFLAGS_REMOVE_* variables Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250611-vdso-absolute-reloc-v3-1-47897d73784b@linutronix.de> References: <20250611-vdso-absolute-reloc-v3-0-47897d73784b@linutronix.de> In-Reply-To: <20250611-vdso-absolute-reloc-v3-0-47897d73784b@linutronix.de> To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1749633741; l=1184; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=OzIhnUie/Ctxfm+QEMkyUANhfsCLwQddvZkNgATaxKY=; b=SugqQlUcXcgVYUV2XtDiRrHWg6Doywxp9o305XEyBXMEA9Un62vvg09cf86xsaWlEwuAbkgFS LdMCSp/k8ELAG8PmZTTud1hV41V8Jio68n3rixW1dpWRLbEL1HwCdhO X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= All vDSO objects need the same treatment. To make changes to both the list of objects and the list of removed flags easier, introduce a helper variable. Signed-off-by: Thomas Wei=C3=9Fschuh Reviewed-by: Alexandre Ghiti Reviewed-by: Nathan Chancellor --- arch/riscv/kernel/vdso/Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/riscv/kernel/vdso/Makefile b/arch/riscv/kernel/vdso/Makef= ile index 9ebb5e590f93a3228c451dca58e6d5cfbbc03ff7..c19c3c76f7c9f6b2f7523a59269= de3b683656323 100644 --- a/arch/riscv/kernel/vdso/Makefile +++ b/arch/riscv/kernel/vdso/Makefile @@ -49,9 +49,10 @@ CPPFLAGS_vdso.lds +=3D -DHAS_VGETTIMEOFDAY endif =20 # Disable -pg to prevent insert call site -CFLAGS_REMOVE_vgettimeofday.o =3D $(CC_FLAGS_FTRACE) $(CC_FLAGS_SCS) -CFLAGS_REMOVE_getrandom.o =3D $(CC_FLAGS_FTRACE) $(CC_FLAGS_SCS) -CFLAGS_REMOVE_hwprobe.o =3D $(CC_FLAGS_FTRACE) $(CC_FLAGS_SCS) +CFLAGS_REMOVE_VDSO =3D $(CC_FLAGS_FTRACE) $(CC_FLAGS_SCS) +CFLAGS_REMOVE_vgettimeofday.o =3D $(CFLAGS_REMOVE_VDSO) +CFLAGS_REMOVE_getrandom.o =3D $(CFLAGS_REMOVE_VDSO) +CFLAGS_REMOVE_hwprobe.o =3D $(CFLAGS_REMOVE_VDSO) =20 # Force dependency $(obj)/vdso.o: $(obj)/vdso.so --=20 2.49.0 From nobody Sat Oct 11 08:30:48 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 B049625C837 for ; Wed, 11 Jun 2025 09:22:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749633749; cv=none; b=nIlVynHqvj10RrYhoumvrDaH6YIWxksC9xf6mnfm+SNN511gfTfyWsjYYK2UPZ3BjaFGfghVu87Zs5PP/Rk5Kk92gtM8G5Rhr+TY3w5gqHio+50s1OWIAiijkgYBfQtFm6jz1/Y53Q2zvYxKk7C0hltKsDHAcNMQGzG7NKBR4Qw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749633749; c=relaxed/simple; bh=8B4x12CzHaxPC9X4pfyxH+ejQsD81seE02RnNXMkzSE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Va3U9rahUxJdrV9UYkH2gGV08rEfWdXxnYT8JsE1UmmHEvzdMH0K9CB3Q4nP6+UJnWkFHlroXRZDgneDgrE3Q5FE/PZsNmPC7eRKM4D7b6qAYkKk0MHbnd0tNmXpq1cA4TCIfVmoNrTIjuYZSRyRac6vosRGfg+AYw129CpYXSE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=t2CcHL/N; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=xP7vQrJi; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="t2CcHL/N"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="xP7vQrJi" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1749633745; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qtawFApvVC/il3WzGQ5ouLlAcuOcFQ89dR48c5s84KQ=; b=t2CcHL/NgPvPqqPO5DyCZ65WcPtZlecd4bwAusp8WJzx9DkTuK1mi3X7WoXgwRMTPQlDtu E2fudBz0nBDHxplzTT7TD7BJz79l3wmbBcGOcZ61Cf+RQgzJG8q9WQN16BMFwThSh25X1R kdHD2t2SaJBoGmQXanudASPg5lXZAaf2EsQkO+aTTe2u1t/6H1CgoDsFfJCPMQsZk4gvCY KbtJdALtEHnX1SbWi8ia6YtvZd+KaPE3JUEprRE+kWNgsaXGlVfrQvUwk1C3T4gqAqLiy9 AwpLjDOmGbbLUo/q8YnA5w5xdTj0K+VCzuU8Sbq+2yuAuAOD/cRhylzrTnQH7w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1749633745; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qtawFApvVC/il3WzGQ5ouLlAcuOcFQ89dR48c5s84KQ=; b=xP7vQrJiwJzrto/eGP3l0LRHVTKCO8A0mjI0RKYg+ofFAFuliV0w5ytJUMJAq1i6wi+zcr xQhZeqrOHrHODfCQ== Date: Wed, 11 Jun 2025 11:22:13 +0200 Subject: [PATCH v3 2/3] riscv: vdso: Disable LTO for the vDSO Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250611-vdso-absolute-reloc-v3-2-47897d73784b@linutronix.de> References: <20250611-vdso-absolute-reloc-v3-0-47897d73784b@linutronix.de> In-Reply-To: <20250611-vdso-absolute-reloc-v3-0-47897d73784b@linutronix.de> To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1749633741; l=1308; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=8B4x12CzHaxPC9X4pfyxH+ejQsD81seE02RnNXMkzSE=; b=MeVEZf4Tcm6ZHthWxkq9DUB7vjcgxE6V95k51kMGjendRw+PKJPPvVusb/jXN1+RUNZvon5rI Da78ZxH2LuxDWaGizyH12vN351IGlYgjYr82O6nMWi3zsWSrxFlm/8m X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= All the other architectures supporting LTO (x86, arm64, loongarch) do not use it for the vDSO. Its is problematic for some upcoming compile-time validation of the generated object code. The LTO object files do not contain the necessary relocation information and -flto-fat-objects is not compatible with clang < 16. For consistency and to enable the mentioned compile-time checks, disable LTO for the vDSO. The vDSO heavily uses __always_inline anyways. Signed-off-by: Thomas Wei=C3=9Fschuh Reviewed-by: Nathan Chancellor --- arch/riscv/kernel/vdso/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/kernel/vdso/Makefile b/arch/riscv/kernel/vdso/Makef= ile index c19c3c76f7c9f6b2f7523a59269de3b683656323..9f1bf5bae9bd473e43d9fd3022e= 9e1a185128b73 100644 --- a/arch/riscv/kernel/vdso/Makefile +++ b/arch/riscv/kernel/vdso/Makefile @@ -49,7 +49,7 @@ CPPFLAGS_vdso.lds +=3D -DHAS_VGETTIMEOFDAY endif =20 # Disable -pg to prevent insert call site -CFLAGS_REMOVE_VDSO =3D $(CC_FLAGS_FTRACE) $(CC_FLAGS_SCS) +CFLAGS_REMOVE_VDSO =3D $(CC_FLAGS_FTRACE) $(CC_FLAGS_SCS) $(CC_FLAGS_LTO) CFLAGS_REMOVE_vgettimeofday.o =3D $(CFLAGS_REMOVE_VDSO) CFLAGS_REMOVE_getrandom.o =3D $(CFLAGS_REMOVE_VDSO) CFLAGS_REMOVE_hwprobe.o =3D $(CFLAGS_REMOVE_VDSO) --=20 2.49.0 From nobody Sat Oct 11 08:30:48 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 3373225C83E for ; Wed, 11 Jun 2025 09:22:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749633748; cv=none; b=Ty89yuxg12pU+NlAArxJybpEVk3tBRjPd++sT7qNlTnp01s1/LDefSuvw8yppr9A32oCNHnnR2wKTtFz3+r4f3nB4mKMjAjLRFPdO3wuBaIgZtl62ZtsO8nsqn80KFwWmPrL6RHfjr29v8/fTqUAA0FR+nnnhsLKfW30Je3iBG8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749633748; c=relaxed/simple; bh=mIAtGDHPvKeYdgafPU461SwU1pvMX0e9L3qKBEtEQp4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Usl1DhtXA819+VlCQs2O6MctH5ehvOEUQRGUnjdGrmoZ945Qe02VscXBdAXqnQz6ndPZ5wpK3guIxd0Tt4la9o3ncSE7LvrzDvKF6eAujxcytT2QSPU7USgr/+p8nJQOm4gFy+c82FZmYzJmW3z1LfAnv9wF2A8+4lxtER7Iftg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=GL6NHJdh; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=/7HqhDUo; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="GL6NHJdh"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="/7HqhDUo" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1749633745; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=J0wTJl4RIVSFj/J21gRTDQ3w5OE3XK4ggTZJSCDLD2I=; b=GL6NHJdh8oRCBHoc0pCvwGt+FMm6CmPZDaSPIyv0AwYaPhxb6cgvtH+x7vJMNVY1OvbVAI 0Fcd0Mg5z7ACVlsKkKr9GLrbmp/yN6erZB9Dqysrq4OJ5Wp5KOgoHP7NEjAup6dOP20C8+ Qj+nQ+46L5YgUEr8Cv78NgVN7B8FVAJZgeIQcMtleDiPCobxuF791zte11xQITQbB5DbJP qEkaZ7pqplVdht4OWG2xF9S46mLE85l7rmEMx26hg5dh0fevA7HHj2iBN0hE4s6ycTm9M3 V7o+ysyNJ6bKBnaNaWJpGv8ctCgNrT1J8rRDGZC3cRjx3oxsP4gTKds75cdnJw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1749633745; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=J0wTJl4RIVSFj/J21gRTDQ3w5OE3XK4ggTZJSCDLD2I=; b=/7HqhDUo5GHztwH4u2uOVsaIcikw4P3TFVxK9YTQ1WvyeNbCBVTlHRglhhFUb3ok/wdW/N 137plfNu6ojVANAg== Date: Wed, 11 Jun 2025 11:22:14 +0200 Subject: [PATCH v3 3/3] vdso: Reject absolute relocations during build Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250611-vdso-absolute-reloc-v3-3-47897d73784b@linutronix.de> References: <20250611-vdso-absolute-reloc-v3-0-47897d73784b@linutronix.de> In-Reply-To: <20250611-vdso-absolute-reloc-v3-0-47897d73784b@linutronix.de> To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1749633741; l=2264; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=mIAtGDHPvKeYdgafPU461SwU1pvMX0e9L3qKBEtEQp4=; b=saA8vG7G5+nuYZSAIasKPk5cLM4d6JKHzQ2YGvNfixdyOAnpwSO6H7XzKmIVedADkizpqv1bb jU+UQS4HuWOD3hih0qgzsdHbpqtAnSo8QNwysBfBekBxh9MTlcW2DV1 X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= All vDSO code needs to be completely position independent. Symbol references are marked as hidden so the compiler emits PC-relative relocations. However there are cases where the compiler may still emit absolute relocations, as they are valid in regular PIC DSO code. These would be resolved by the linker and will break at runtime. This has been observed on arm64 under some circumstances, see commit 0c314cda9325 ("arm64: vdso: Work around invalid absolute relocations= from GCC") Introduce a build-time check for absolute relocations. The check is done on the object files as the relocations will not exist anymore in the final DSO. As there is no extension point for the compilation of each object file, perform the validation in vdso_check. Debug information can contain legal absolute relocations and readelf can not print relocations from the .text section only. Make use of the fact that all global vDSO symbols follow the naming pattern "vdso_u_". Link: https://lore.kernel.org/lkml/aApGPAoctq_eoE2g@t14ultra/ Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D120002 Signed-off-by: Thomas Wei=C3=9Fschuh Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor --- lib/vdso/Makefile.include | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/vdso/Makefile.include b/lib/vdso/Makefile.include index cedbf15f80874d4bb27c097244bc5b11272f261c..04257d0f28c0ed324e31adbb684= 97181085752f8 100644 --- a/lib/vdso/Makefile.include +++ b/lib/vdso/Makefile.include @@ -12,7 +12,13 @@ c-getrandom-$(CONFIG_VDSO_GETRANDOM) :=3D $(addprefix $(= GENERIC_VDSO_DIR), getrand # # As a workaround for some GNU ld ports which produce unneeded R_*_NONE # dynamic relocations, ignore R_*_NONE. +# +# Also validate that no absolute relocations against global symbols are pr= esent +# in the object files. quiet_cmd_vdso_check =3D VDSOCHK $@ cmd_vdso_check =3D if $(READELF) -rW $@ | grep -v _NONE | grep -q " = R_\w*_"; \ then (echo >&2 "$@: dynamic relocations are not supported"; \ + rm -f $@; /bin/false); fi && \ + if $(READELF) -rW $(filter %.o, $(real-prereqs)) | grep -q " R_\w= *_ABS.*vdso_u_"; \ + then (echo >&2 "$@: absolute relocations are not supported"; \ rm -f $@; /bin/false); fi --=20 2.49.0