Index: head/lib/libsysdecode/utrace.c =================================================================== --- head/lib/libsysdecode/utrace.c +++ head/lib/libsysdecode/utrace.c @@ -124,6 +124,10 @@ 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); } Index: head/libexec/rtld-elf/rtld.c =================================================================== --- head/libexec/rtld-elf/rtld.c +++ head/libexec/rtld-elf/rtld.c @@ -764,6 +764,7 @@ rtld_vsnprintf(buf, sizeof buf, fmt, ap); error_message = buf; va_end(ap); + LD_UTRACE(UTRACE_RTLD_ERROR, NULL, NULL, 0, 0, error_message); } /* Index: head/libexec/rtld-elf/rtld_utrace.h =================================================================== --- head/libexec/rtld-elf/rtld_utrace.h +++ head/libexec/rtld-elf/rtld_utrace.h @@ -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"