rtld-elf: Reuse _BASENAME_RTLD for debug.h rather than duplicating logic
Reviewed by: kib, brooks, jhb Differential Revision: https://reviews.freebsd.org/D40919
This commit is contained in:
parent
be01082b86
commit
5181fe24b2
@ -37,6 +37,7 @@
|
|||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include "rtld_paths.h"
|
||||||
#include "rtld_printf.h"
|
#include "rtld_printf.h"
|
||||||
|
|
||||||
void debug_printf(const char *, ...) __printflike(1, 2);
|
void debug_printf(const char *, ...) __printflike(1, 2);
|
||||||
@ -48,17 +49,11 @@ extern int debug;
|
|||||||
#define dbg(...) ((void) 0)
|
#define dbg(...) ((void) 0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef COMPAT_32BIT
|
#define assert(cond) ((cond) ? (void) 0 : \
|
||||||
#define _MYNAME "ld-elf.so.1"
|
(msg(_BASENAME_RTLD ": assert failed: " __FILE__ ":" \
|
||||||
#else
|
|
||||||
#define _MYNAME "ld-elf32.so.1"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define assert(cond) ((cond) ? (void) 0 : \
|
|
||||||
(msg(_MYNAME ": assert failed: " __FILE__ ":" \
|
|
||||||
__XSTRING(__LINE__) "\n"), abort()))
|
__XSTRING(__LINE__) "\n"), abort()))
|
||||||
#define msg(s) rtld_putstr(s)
|
#define msg(s) rtld_putstr(s)
|
||||||
#define trace() msg(_MYNAME ": " __XSTRING(__LINE__) "\n")
|
#define trace() msg(_BASENAME_RTLD ": " __XSTRING(__LINE__) "\n")
|
||||||
|
|
||||||
|
|
||||||
#endif /* DEBUG_H */
|
#endif /* DEBUG_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user