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 2B239847C for ; Thu, 12 Jan 2023 19:52:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E02C0C433D2; Thu, 12 Jan 2023 19:52:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673553144; bh=QTRTDX1aspFUjlsVcI/SSLmUL0J8HraBN87iqVH8u4A=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=sIBKwM6q2YIoegjX0mohwbxLZDvtg1x7VE5rn/66w7ZeSqLQCpyi7Haj6GcbHL6EX d3wEqU1n01YsoXaCDqglbLpFO6O/2DfYm9v9AyoGeO5Gv29cmVsj/JN4laS4tA2G6Y fdJ8Q3oYijHq1pWEK/zVM7DmOUix8oitEt3if7gIRvddCCxeXXKwO/+MBGXKGm0xvS WEqQG+X2ubN42vYPdFbtyKrPCOKxrGgnG8VqnNrdHTFwjlVw6Boj7ZsfyLEfHdVpyd LzTI05jKJ7gT03Dniby8DwWuAq4vHVNgXIeNt4MNpFbqKe25ryKjUV91uMQp5o4uad hrDmHC87maTqQ== From: Mark Brown Date: Thu, 12 Jan 2023 19:51:50 +0000 Subject: [PATCH 4/6] kselftest/arm64: Initialise current at build time in signal tests Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230111-arm64-kselftest-clang-v1-4-89c69d377727@kernel.org> References: <20230111-arm64-kselftest-clang-v1-0-89c69d377727@kernel.org> In-Reply-To: <20230111-arm64-kselftest-clang-v1-0-89c69d377727@kernel.org> To: Catalin Marinas , Will Deacon , Shuah Khan , Nathan Chancellor , Nick Desaulniers , Tom Rix Cc: linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, llvm@lists.linux.dev, Mark Brown X-Mailer: b4 0.12-dev-8b3d1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1382; i=broonie@kernel.org; h=from:subject:message-id; bh=QTRTDX1aspFUjlsVcI/SSLmUL0J8HraBN87iqVH8u4A=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBjwGTqYecAhNJ/68Hz+3JWPKmFN3mjZna3w4n07K/K h9NKUNqJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCY8Bk6gAKCRAk1otyXVSH0DYxB/ 9YH/AZ4hQW8JJhM5Y7Ox2Deko1Gjgk+ShcDmSER+HI7olFW73U/z/vsd2yD0GFFGZcxD5rPG+4ODpA u11zn3hPs6rtbaeHK15IFpBI8Ce96gIVu2kinFt1mL6MOAuUGZ+thzKro4Hl31ffHz8YcsC08zn7/V 0w9DjWZ7rCXnNhHi/1U/Qtifen6vSRHS+hXIjm8DCB4raN1qq+4mqixf9DpbZqB7pqjMOtjaR6Mkjl UDRHQJpV+skBGnz7fm7xU1i69GAWR+yqIpV6Duh8LGYbCbF9du6YwgBSfkQh+bb1y9jhqcr8K0qDAh hCrgsiiqLndHDckDbIHEAROl9fkv9Y X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB When building with clang the toolchain refuses to link the signals testcases since the assembly code has a reference to current which has no initialiser so is placed in the BSS: /tmp/signals-af2042.o: in function `fake_sigreturn': :51:(.text+0x40): relocation truncated to fit: R_AARCH64_LD_PREL_LO19 against symbol `current' defined in .bss section in /tmp/test_signals-ec1160.o Since the first statement in main() initialises current we may as well fix this by moving the initialisation to build time so the variable doesn't end up in the BSS. Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/signal/test_signals.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/testing/selftests/arm64/signal/test_signals.c b/tools/testing/selftests/arm64/signal/test_signals.c index 416b1ff43199..00051b40d71e 100644 --- a/tools/testing/selftests/arm64/signal/test_signals.c +++ b/tools/testing/selftests/arm64/signal/test_signals.c @@ -12,12 +12,10 @@ #include "test_signals.h" #include "test_signals_utils.h" -struct tdescr *current; +struct tdescr *current = &tde; int main(int argc, char *argv[]) { - current = &tde; - ksft_print_msg("%s :: %s\n", current->name, current->descr); if (test_setup(current) && test_init(current)) { test_run(current); -- 2.30.2 From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5065BC54EBE for ; Thu, 12 Jan 2023 20:23:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=oTkb5L1IjCJ/JQkbwN4zomT7I4LCyT9R6HP/AAk2Nz4=; b=QeXvhUrQNljfTB TY1dI4VO+mT4u65pdO7ojQWkkrPRMFYSaqbwPJIi3iz/EbqoARalp2oYVncJUKQsA50wFIDOxSE4k lXr0LfxpUN77zMyqzlVcyz9RWE0IR7R6JX5k8xIY07LZooZQiNTW7aXW6EE4UKtrNgQ89pY+uhXer igQnEFQ9pMthPi7NqyOml9NYuNpJeL1e2I+cY6ciC+g/wFaepAznzCK0cfxOMzZWWvxQIz855Fc+U oEIIe+Gf/um/fXT8H3yqYRO11fz96QcqAM2HK+NpaV82m5FBOSoJakJ8kNjW4xbybdmSgk75DgeF7 iMwdOPcYnHEcHsYglsYg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pG45q-00GrqX-IQ; Thu, 12 Jan 2023 20:22:34 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pG3ch-00Geom-F8 for linux-arm-kernel@lists.infradead.org; Thu, 12 Jan 2023 19:52:28 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 24F04B82011; Thu, 12 Jan 2023 19:52:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E02C0C433D2; Thu, 12 Jan 2023 19:52:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673553144; bh=QTRTDX1aspFUjlsVcI/SSLmUL0J8HraBN87iqVH8u4A=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=sIBKwM6q2YIoegjX0mohwbxLZDvtg1x7VE5rn/66w7ZeSqLQCpyi7Haj6GcbHL6EX d3wEqU1n01YsoXaCDqglbLpFO6O/2DfYm9v9AyoGeO5Gv29cmVsj/JN4laS4tA2G6Y fdJ8Q3oYijHq1pWEK/zVM7DmOUix8oitEt3if7gIRvddCCxeXXKwO/+MBGXKGm0xvS WEqQG+X2ubN42vYPdFbtyKrPCOKxrGgnG8VqnNrdHTFwjlVw6Boj7ZsfyLEfHdVpyd LzTI05jKJ7gT03Dniby8DwWuAq4vHVNgXIeNt4MNpFbqKe25ryKjUV91uMQp5o4uad hrDmHC87maTqQ== From: Mark Brown Date: Thu, 12 Jan 2023 19:51:50 +0000 Subject: [PATCH 4/6] kselftest/arm64: Initialise current at build time in signal tests MIME-Version: 1.0 Message-Id: <20230111-arm64-kselftest-clang-v1-4-89c69d377727@kernel.org> References: <20230111-arm64-kselftest-clang-v1-0-89c69d377727@kernel.org> In-Reply-To: <20230111-arm64-kselftest-clang-v1-0-89c69d377727@kernel.org> To: Catalin Marinas , Will Deacon , Shuah Khan , Nathan Chancellor , Nick Desaulniers , Tom Rix Cc: linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, llvm@lists.linux.dev, Mark Brown X-Mailer: b4 0.12-dev-8b3d1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1382; i=broonie@kernel.org; h=from:subject:message-id; bh=QTRTDX1aspFUjlsVcI/SSLmUL0J8HraBN87iqVH8u4A=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBjwGTqYecAhNJ/68Hz+3JWPKmFN3mjZna3w4n07K/K h9NKUNqJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCY8Bk6gAKCRAk1otyXVSH0DYxB/ 9YH/AZ4hQW8JJhM5Y7Ox2Deko1Gjgk+ShcDmSER+HI7olFW73U/z/vsd2yD0GFFGZcxD5rPG+4ODpA u11zn3hPs6rtbaeHK15IFpBI8Ce96gIVu2kinFt1mL6MOAuUGZ+thzKro4Hl31ffHz8YcsC08zn7/V 0w9DjWZ7rCXnNhHi/1U/Qtifen6vSRHS+hXIjm8DCB4raN1qq+4mqixf9DpbZqB7pqjMOtjaR6Mkjl UDRHQJpV+skBGnz7fm7xU1i69GAWR+yqIpV6Duh8LGYbCbF9du6YwgBSfkQh+bb1y9jhqcr8K0qDAh hCrgsiiqLndHDckDbIHEAROl9fkv9Y X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230112_115227_725388_042EC3D3 X-CRM114-Status: GOOD ( 12.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When building with clang the toolchain refuses to link the signals testcases since the assembly code has a reference to current which has no initialiser so is placed in the BSS: /tmp/signals-af2042.o: in function `fake_sigreturn': :51:(.text+0x40): relocation truncated to fit: R_AARCH64_LD_PREL_LO19 against symbol `current' defined in .bss section in /tmp/test_signals-ec1160.o Since the first statement in main() initialises current we may as well fix this by moving the initialisation to build time so the variable doesn't end up in the BSS. Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/signal/test_signals.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/testing/selftests/arm64/signal/test_signals.c b/tools/testing/selftests/arm64/signal/test_signals.c index 416b1ff43199..00051b40d71e 100644 --- a/tools/testing/selftests/arm64/signal/test_signals.c +++ b/tools/testing/selftests/arm64/signal/test_signals.c @@ -12,12 +12,10 @@ #include "test_signals.h" #include "test_signals_utils.h" -struct tdescr *current; +struct tdescr *current = &tde; int main(int argc, char *argv[]) { - current = &tde; - ksft_print_msg("%s :: %s\n", current->name, current->descr); if (test_setup(current) && test_init(current)) { test_run(current); -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel