ld-elf.so: make LD_DEBUG always functional.

This causes some increase of the dynamic linker size, but benefits of
avoiding compiling private copy or the linker when debugging is
required. definitely worth it.

The dbg() calls can be compiled out by defining LD_NO_DEBUG symbol.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2019-04-14 18:04:53 +00:00
parent 5cf92d7aed
commit e3e21edb19
2 changed files with 3 additions and 3 deletions

View file

@ -2,7 +2,7 @@
# Use the following command to build local debug version of dynamic
# linker:
# make DEBUG_FLAGS=-g DEBUG=-DDEBUG WITHOUT_TESTS=yes all
# make DEBUG_FLAGS=-g WITHOUT_TESTS=yes all
.include <src.opts.mk>
PACKAGE= clibs

View file

@ -39,10 +39,10 @@
#include <string.h>
#include <unistd.h>
extern void debug_printf(const char *, ...) __printflike(1, 2);
void debug_printf(const char *, ...) __printflike(1, 2);
extern int debug;
#ifdef DEBUG
#ifndef NO_LD_DEBUG
#define dbg(...) debug_printf(__VA_ARGS__)
#else
#define dbg(...) ((void) 0)