Add dummy TLS variable to no_syscall test master
authorMichael Jeanson <mjeanson@efficios.com>
Thu, 29 Aug 2024 18:53:02 +0000 (14:53 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 29 Aug 2024 19:46:51 +0000 (15:46 -0400)
Ensure the main executable has at least one TLS variable which will be
allocated before the rseq area, making sure the rseq_offset is not 0.  This
allows testing that the rseq_offset variable is properly initialized by
checking it is not 0.

Most toolchains will add at least one main exec TLS variable but it's
currently not the case on RISC-V.

Change-Id: Ie29bcaa1e008e99953a4f19e19f05c8b85dac62d
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
tests/no_syscall_test.c

index 56bd8714f83f08f06a8ef84251a048e81d50fb82..b7462b133e28d4555d20e680e67462dc8af81a50 100644 (file)
 
 #define NR_TESTS 4
 
+/*
+ * Ensure the main executable has at least one TLS variable which will be
+ * allocated before the rseq area, making sure the rseq_offset is not 0.  This
+ * allows testing that the rseq_offset variable is properly initialized by
+ * checking it is not 0.
+ *
+ * Most toolchains will add at least one main exec TLS variable but it's
+ * currently not the case on RISC-V.
+ */
+__thread int dummy_tls = -1;
+
 /*
  * Check the state of the public symbols when the rseq syscall is unavailable.
  *
This page took 0.024449 seconds and 4 git commands to generate.