From 0353195f344666256dba474a15c9ba22cf0cccc9 Mon Sep 17 00:00:00 2001 From: Dima Zavin Date: Fri, 29 May 2009 17:30:25 -0700 Subject: linker: Give more context for failures during library dependency resolution. Signed-off-by: Dima Zavin --- linker/linker.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/linker/linker.c b/linker/linker.c index 08a591a..e398f82 100644 --- a/linker/linker.c +++ b/linker/linker.c @@ -116,6 +116,7 @@ HOODLUM(free, void, (void *ptr)); HOODLUM(realloc, void *, (void *ptr, size_t size)); HOODLUM(calloc, void *, (size_t cnt, size_t size)); +static char tmp_err_buf[768]; static char __linker_dl_err_buf[768]; #define DL_ERR(fmt, x...) \ do { \ @@ -1615,7 +1616,9 @@ static int link_image(soinfo *si, unsigned wr_offset) DEBUG("%5d %s needs %s\n", pid, si->name, si->strtab + d[1]); soinfo *lsi = find_library(si->strtab + d[1]); if(lsi == 0) { - DL_ERR("%5d could not load '%s'\n", pid, si->strtab + d[1]); + strlcpy(tmp_err_buf, linker_get_error(), sizeof(tmp_err_buf)); + DL_ERR("%5d could not load needed library '%s' for '%s' (%s)\n", + pid, si->strtab + d[1], si->name, tmp_err_buf); goto fail; } lsi->refcount++; -- cgit v1.1