aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/testing/selftests/arm64/signal
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2023-01-12 19:51:50 +0000
committerCatalin Marinas <catalin.marinas@arm.com>2023-01-20 14:30:45 +0000
commit6e4b4f0eca88e47def703f90a403fef5b96730d5 (patch)
tree877253c0f90054ad4ac7384e3306052dad3081ee /tools/testing/selftests/arm64/signal
parentkselftest/arm64: Don't pass headers to the compiler as source (diff)
downloadwireguard-linux-6e4b4f0eca88e47def703f90a403fef5b96730d5.tar.xz
wireguard-linux-6e4b4f0eca88e47def703f90a403fef5b96730d5.zip
kselftest/arm64: Initialise current at build time in signal tests
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': <unknown>: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 <broonie@kernel.org> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Link: https://lore.kernel.org/r/20230111-arm64-kselftest-clang-v1-4-89c69d377727@kernel.org Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'tools/testing/selftests/arm64/signal')
-rw-r--r--tools/testing/selftests/arm64/signal/test_signals.c4
1 files changed, 1 insertions, 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);