From: "Anthony G. Basile" <[email protected]>

DL_CALL_FCT is defined in <bits/dlfcn.h> on glibc systems and is
a macro for calling functions in shared objects with dlsym.  This
is useful for profiling since these functions would otherwise not
use the PLT and so not be counted when profiling with gprof.

Signed-off-by: Anthony G. Basile <[email protected]>
---
 src/ChangeLog | 4 ++++
 src/ld.h      | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/src/ChangeLog b/src/ChangeLog
index 2ee0d1d..2bb2f0b 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,9 @@
 2015-05-04  Anthony G. Basile  <[email protected]>
 
+       * ld.h (DL_CALL_FCT): Define if this macro is undefined.
+
+2015-05-04  Anthony G. Basile  <[email protected]>
+
        * ar.c (do_oper_extract): Use futimes or utimes depending on
        HAVE_FUTIMES.
        * strip.c (handle_elf, handle_ar): Likewise.
diff --git a/src/ld.h b/src/ld.h
index 29f4031..e64649c 100644
--- a/src/ld.h
+++ b/src/ld.h
@@ -24,6 +24,9 @@
 #include <stdio.h>
 #include "xelf.h"
 
+#ifndef DL_CALL_FCT
+#define DL_CALL_FCT(f, a) f a
+#endif
 
 /* Recommended size of the buffer passed to ld_strerror.  */
 #define ERRBUFSIZE     (512)
-- 
1.8.1.4

Reply via email to