This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
[PATCH] Fix test FAIL with -O2
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Date: Thu, 5 Dec 2013 16:16:14 +0100
- Subject: [PATCH] Fix test FAIL with -O2
Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
---
tests/ChangeLog | 5 +++++
tests/backtrace-child.c | 4 +++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 8992568..9e4cd9a 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,8 @@
+2013-12-05 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ Fix test FAIL with -O2.
+ * backtrace-child.c (sigusr2): Add NOINLINE_NOCLONE and final asm stub.
+
2013-12-05 Mark Wielaard <mjw@redhat.com>
=
* backtrace-data.c (main): If unsupported also print to stderr.
diff --git a/tests/backtrace-child.c b/tests/backtrace-child.c
index 2bc0ede..0db1258 100644
--- a/tests/backtrace-child.c
+++ b/tests/backtrace-child.c
@@ -93,7 +93,7 @@ static int ptraceme, gencore;
=
/* Execution will arrive here from jmp by an artificial ptrace-spawn signa=
l. */
=
-static void
+static NOINLINE_NOCLONE void
sigusr2 (int signo)
{
assert (signo =3D=3D SIGUSR2);
@@ -105,6 +105,8 @@ sigusr2 (int signo)
}
/* Here we dump the core for --gencore. */
raise (SIGABRT);
+ /* Avoid tail call optimization for the raise call. */
+ asm volatile ("");
}
=
static NOINLINE_NOCLONE void
-- =
1.8.3.1
--===============1815843969515966161==--