aboutsummaryrefslogtreecommitdiff
path: root/debug
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2024-12-23 05:11:58 +0800
committerH.J. Lu <hjl.tools@gmail.com>2024-12-23 06:28:55 +0800
commita2b0ff98a0d44259cc5f6bd7d3a3676ae9f8996a (patch)
tree7816983cdeea6e6c32dd005c76da785811ea3047 /debug
parent3fb895ac88e99201573352b1abc18db4340ecede (diff)
downloadglibc-a2b0ff98a0d44259cc5f6bd7d3a3676ae9f8996a.tar.xz
glibc-a2b0ff98a0d44259cc5f6bd7d3a3676ae9f8996a.zip
include/sys/cdefs.h: Add __attribute_optimization_barrier__
Add __attribute_optimization_barrier__ to disable inlining and cloning on a function. For Clang, expand it to __attribute__ ((optnone)) Otherwise, expand it to __attribute__ ((noinline, clone)) Co-Authored-By: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'debug')
-rw-r--r--debug/tst-backtrace.h2
-rw-r--r--debug/tst-ssp-1.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/debug/tst-backtrace.h b/debug/tst-backtrace.h
index 53239dad59..0ed38b6892 100644
--- a/debug/tst-backtrace.h
+++ b/debug/tst-backtrace.h
@@ -33,7 +33,7 @@ volatile int x;
/* Use this attribute to prevent inlining, so that all expected frames
are present. */
-#define NO_INLINE __attribute__ ((noinline, noclone, weak))
+#define NO_INLINE __attribute__ ((weak)) __attribute_optimization_barrier__
/* Look for a match in SYM from backtrace_symbols to NAME, a fragment
of a function name. Ignore the filename before '(', but presume
diff --git a/debug/tst-ssp-1.c b/debug/tst-ssp-1.c
index a1e4fb0630..2c8861ae59 100644
--- a/debug/tst-ssp-1.c
+++ b/debug/tst-ssp-1.c
@@ -21,7 +21,7 @@
#include <signal.h>
static void
-__attribute__ ((noinline, noclone))
+__attribute_optimization_barrier__
test (char *foo)
{
int i;