1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-04 09:09:56 +00:00

Extend LD_UTRACE by also generating utrace(2) log events for runtime linker

errors.

Reviewed by:	kib, jhb
Approved by:	jhb(mentor)
MFC after:	1 week
Differential Revision:	 D9347
This commit is contained in:
Peter Jeremy 2017-01-30 08:38:32 +00:00
parent eac79e7755
commit 8787928589
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=312984
3 changed files with 6 additions and 0 deletions

View File

@ -124,6 +124,10 @@ print_utrace_rtld(FILE *fp, void *p)
fprintf(fp, "RTLD: %p = dlsym(%p, %s)", ut->mapbase, ut->handle,
ut->name);
break;
case UTRACE_RTLD_ERROR:
fprintf(fp, "RTLD: error: %s\n", ut->name);
break;
default:
return (0);
}

View File

@ -764,6 +764,7 @@ _rtld_error(const char *fmt, ...)
rtld_vsnprintf(buf, sizeof buf, fmt, ap);
error_message = buf;
va_end(ap);
LD_UTRACE(UTRACE_RTLD_ERROR, NULL, NULL, 0, 0, error_message);
}
/*

View File

@ -45,6 +45,7 @@
#define UTRACE_FINI_CALL 10
#define UTRACE_DLSYM_START 11
#define UTRACE_DLSYM_STOP 12
#define UTRACE_RTLD_ERROR 13
#define RTLD_UTRACE_SIG_SZ 4
#define RTLD_UTRACE_SIG "RTLD"