From 488159627f4f579a80b71c5f7713126864d5623f Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Mon, 10 Jun 2013 14:11:04 +0200 Subject: [PATCH] Prevent inlining for more functions. Clang is inlining quite aggressively. --- src/ldpreload.h | 6 ++++++ src/trackfds.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ldpreload.h b/src/ldpreload.h index 6ef2911..57f923b 100644 --- a/src/ldpreload.h +++ b/src/ldpreload.h @@ -30,6 +30,12 @@ #include #include +static void *dlsym_function(char const *name) +#ifdef HAVE___ATTRIBUTE__ + __attribute__((noinline)) +#endif +; + /* Load the function name using dlsym() and return it. Terminate program on * failure. Split in function and macro to reduce code inserted into the * function using the macro. */ diff --git a/src/trackfds.h b/src/trackfds.h index 175f1e3..eddff4c 100644 --- a/src/trackfds.h +++ b/src/trackfds.h @@ -300,7 +300,7 @@ static int tracked_fds_remove(int fd) { return 0; } -static int tracked_fds_find_slow(int fd); +static int tracked_fds_find_slow(int fd) __noinline; /* * tracked_fds_find() is called for each hook call and should be as fast as * possible. As most file descriptors are < TRACKFDS_STATIC_COUNT, force the -- 2.45.2