summaryrefslogtreecommitdiff
path: root/ldso/include/ldso.h
diff options
context:
space:
mode:
authorCarmelo Amoroso <carmelo.amoroso@st.com>2007-11-09 09:17:35 +0000
committerCarmelo Amoroso <carmelo.amoroso@st.com>2007-11-09 09:17:35 +0000
commitb4db2019624a08a530e6d0f4376fad3705bf4b05 (patch)
treed5b2886f9670227f0297a9fc8fb27ea283873838 /ldso/include/ldso.h
parentbc186d1e9a004e4a5f932387c1722e6ac19839fa (diff)
Define _dl_assert in libdl only if __DOASSERTS__ is defined. Thanks to Peter Mazinger
Diffstat (limited to 'ldso/include/ldso.h')
-rw-r--r--ldso/include/ldso.h23
1 files changed, 16 insertions, 7 deletions
diff --git a/ldso/include/ldso.h b/ldso/include/ldso.h
index d96d137e9..97f54b72c 100644
--- a/ldso/include/ldso.h
+++ b/ldso/include/ldso.h
@@ -65,20 +65,29 @@ extern int _dl_debug_file;
# define __dl_debug_dprint(fmt, args...) \
_dl_dprintf(_dl_debug_file, "%s:%i: " fmt, __FUNCTION__, __LINE__, ## args);
# define _dl_if_debug_dprint(fmt, args...) \
- do { if (_dl_debug) __dl_debug_dprint(fmt, ## args); } while (0)
-# define _dl_assert(expr) \
+ do { if (_dl_debug) __dl_debug_dprint(fmt, ## args); } while (0)
+#else
+# define __dl_debug_dprint(fmt, args...)
+# define _dl_if_debug_dprint(fmt, args...)
+# define _dl_debug_file 2
+#endif /* __SUPPORT_LD_DEBUG__ */
+
+#ifdef IS_IN_rtld
+# ifdef __SUPPORT_LD_DEBUG__
+# define _dl_assert(expr) \
do { \
if (!(expr)) { \
__dl_debug_dprint("assert(%s)\n", #expr); \
_dl_exit(45); \
} \
} while (0)
+# else
+# define _dl_assert(expr) ((void)0)
+# endif
#else
-# define __dl_debug_dprint(fmt, args...)
-# define _dl_if_debug_dprint(fmt, args...)
-# define _dl_assert(expr)
-# define _dl_debug_file 2
-#endif /* __SUPPORT_LD_DEBUG__ */
+# include <assert.h>
+# define _dl_assert(expr) assert(expr)
+#endif
#ifdef __SUPPORT_LD_DEBUG_EARLY__
# define _dl_debug_early(fmt, args...) __dl_debug_dprint(fmt, ## args)