From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 8B3E4214227; Thu, 12 Dec 2024 17:15:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734023728; cv=none; b=d2il8G49Kh0Z5AYUEqmkcz1JrYEQGd6ZNnIqaaumUBYbZJ3LmOBET3XuQL5WhqC+9H1A5sGIuzvW2HWlIpINu6drZ/9pC8AfNkA47u55M653NX+86jWOxJzBzfkaP6w6Qt/MN8W0gs1Do1s7zX5jUqj6OA/W1gwWVGhZXRq/ji4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734023728; c=relaxed/simple; bh=3Hmebkgn4jfs5AjNwva1z8lsCOlccz+QDIoQRT9wWOw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CZUure4V03Y1ZUeMa4xHG40g+uuFY8AKYqEZIDlZSj0+KIO4fRwSH5hnyhV/svLSoigIX43Kh8/w012EynnoZIARsrgQXeKSTFqgLqZrgSaASRwB2CSy5khYAb+GQxD+G5KcVjfm25zv+LVvp1Edb5Du91Qp9lYxFvTna3W87Po= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=PtfOiRCw; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="PtfOiRCw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0ABC1C4CECE; Thu, 12 Dec 2024 17:15:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1734023728; bh=3Hmebkgn4jfs5AjNwva1z8lsCOlccz+QDIoQRT9wWOw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PtfOiRCwD90AG2hFfPKv5SeGrHTKaD0Ah6G+WNcOeZ23RAoUipvDNklWg6xSu1TjL QFCFGfEXI/03sgjQFK6amipv7gQS5XVSDPsb6O5pVOIT4jkAjWdyeyy7jOAhikgtuY y3iydxk+aFiPP4eZZ4NK9wfg+HedzLWyIuurNsSc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Masahiro Yamada , Will Deacon , Catalin Marinas , Sasha Levin Subject: [PATCH 5.10 063/459] arm64: fix .data.rel.ro size assertion when CONFIG_LTO_CLANG Date: Thu, 12 Dec 2024 15:56:41 +0100 Message-ID: <20241212144256.009885765@linuxfoundation.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241212144253.511169641@linuxfoundation.org> References: <20241212144253.511169641@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Masahiro Yamada [ Upstream commit 340fd66c856651d8c1d29f392dd26ad674d2db0e ] Commit be2881824ae9 ("arm64/build: Assert for unwanted sections") introduced an assertion to ensure that the .data.rel.ro section does not exist. However, this check does not work when CONFIG_LTO_CLANG is enabled, because .data.rel.ro matches the .data.[0-9a-zA-Z_]* pattern in the DATA_MAIN macro. Move the ASSERT() above the RW_DATA() line. Fixes: be2881824ae9 ("arm64/build: Assert for unwanted sections") Signed-off-by: Masahiro Yamada Acked-by: Will Deacon Link: https://lore.kernel.org/r/20241106161843.189927-1-masahiroy@kernel.org Signed-off-by: Catalin Marinas Signed-off-by: Sasha Levin --- arch/arm64/kernel/vmlinux.lds.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S index 71f4b5f24d15f..6922c4b3e974f 100644 --- a/arch/arm64/kernel/vmlinux.lds.S +++ b/arch/arm64/kernel/vmlinux.lds.S @@ -228,6 +228,9 @@ SECTIONS __initdata_end = .; __init_end = .; + .data.rel.ro : { *(.data.rel.ro) } + ASSERT(SIZEOF(.data.rel.ro) == 0, "Unexpected RELRO detected!") + _data = .; _sdata = .; RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_ALIGN) @@ -279,9 +282,6 @@ SECTIONS *(.plt) *(.plt.*) *(.iplt) *(.igot .igot.plt) } ASSERT(SIZEOF(.plt) == 0, "Unexpected run-time procedure linkages detected!") - - .data.rel.ro : { *(.data.rel.ro) } - ASSERT(SIZEOF(.data.rel.ro) == 0, "Unexpected RELRO detected!") } #include "image-vars.h" -- 2.43.0