Lines 164-169
Link Here
|
164 |
static char *ld_elf_hints_path; /* Environment variable for alternative hints path */ |
164 |
static char *ld_elf_hints_path; /* Environment variable for alternative hints path */ |
165 |
static char *ld_tracing; /* Called from ldd to print libs */ |
165 |
static char *ld_tracing; /* Called from ldd to print libs */ |
166 |
static char *ld_utrace; /* Use utrace() to log events. */ |
166 |
static char *ld_utrace; /* Use utrace() to log events. */ |
|
|
167 |
static char *ld_printerror; /* Report _rtld_error() messages to stdout */ |
167 |
static Obj_Entry *obj_list; /* Head of linked list of shared objects */ |
168 |
static Obj_Entry *obj_list; /* Head of linked list of shared objects */ |
168 |
static Obj_Entry **obj_tail; /* Link field of last object in list */ |
169 |
static Obj_Entry **obj_tail; /* Link field of last object in list */ |
169 |
static Obj_Entry *obj_main; /* The main program shared object */ |
170 |
static Obj_Entry *obj_main; /* The main program shared object */ |
Lines 244-249
Link Here
|
244 |
(dlp)->num_alloc = obj_count, \ |
245 |
(dlp)->num_alloc = obj_count, \ |
245 |
(dlp)->num_used = 0) |
246 |
(dlp)->num_used = 0) |
246 |
|
247 |
|
|
|
248 |
/* |
249 |
* The following macros and struct utrace_rtld must be kept aligned with |
250 |
* the equivalent code in kdump.c |
251 |
*/ |
247 |
#define UTRACE_DLOPEN_START 1 |
252 |
#define UTRACE_DLOPEN_START 1 |
248 |
#define UTRACE_DLOPEN_STOP 2 |
253 |
#define UTRACE_DLOPEN_STOP 2 |
249 |
#define UTRACE_DLCLOSE_START 3 |
254 |
#define UTRACE_DLCLOSE_START 3 |
Lines 254-259
Link Here
|
254 |
#define UTRACE_PRELOAD_FINISHED 8 |
259 |
#define UTRACE_PRELOAD_FINISHED 8 |
255 |
#define UTRACE_INIT_CALL 9 |
260 |
#define UTRACE_INIT_CALL 9 |
256 |
#define UTRACE_FINI_CALL 10 |
261 |
#define UTRACE_FINI_CALL 10 |
|
|
262 |
#define UTRACE_RTLD_ERROR 11 |
257 |
|
263 |
|
258 |
struct utrace_rtld { |
264 |
struct utrace_rtld { |
259 |
char sig[4]; /* 'RTLD' */ |
265 |
char sig[4]; /* 'RTLD' */ |
Lines 384-389
Link Here
|
384 |
(ld_elf_hints_path != NULL); |
390 |
(ld_elf_hints_path != NULL); |
385 |
ld_tracing = getenv(LD_ "TRACE_LOADED_OBJECTS"); |
391 |
ld_tracing = getenv(LD_ "TRACE_LOADED_OBJECTS"); |
386 |
ld_utrace = getenv(LD_ "UTRACE"); |
392 |
ld_utrace = getenv(LD_ "UTRACE"); |
|
|
393 |
ld_printerror = getenv(LD_ "PRINT_ERROR"); |
387 |
|
394 |
|
388 |
if ((ld_elf_hints_path == NULL) || strlen(ld_elf_hints_path) == 0) |
395 |
if ((ld_elf_hints_path == NULL) || strlen(ld_elf_hints_path) == 0) |
389 |
ld_elf_hints_path = _PATH_ELF_HINTS; |
396 |
ld_elf_hints_path = _PATH_ELF_HINTS; |
Lines 612-617
Link Here
|
612 |
vsnprintf(buf, sizeof buf, fmt, ap); |
619 |
vsnprintf(buf, sizeof buf, fmt, ap); |
613 |
error_message = buf; |
620 |
error_message = buf; |
614 |
va_end(ap); |
621 |
va_end(ap); |
|
|
622 |
if (ld_printerror != NULL && ld_printerror != '\0') |
623 |
printf("RTLD Error: %s\n", error_message); |
624 |
LD_UTRACE(UTRACE_RTLD_ERROR, NULL, NULL, 0, 0, error_message); |
615 |
} |
625 |
} |
616 |
|
626 |
|
617 |
/* |
627 |
/* |