am dde94f4c: am 8b4e8a93: Merge "Improve the dynamic linker diagnostics."

* commit 'dde94f4c1664c6908d9a2944aff84e8667557d02':
  Improve the dynamic linker diagnostics.
This commit is contained in:
Elliott Hughes 2012-08-29 14:06:58 -07:00 committed by Android Git Automerger
commit 8c368b5d1d

View file

@ -162,12 +162,12 @@ DISALLOW_ALLOCATION(void*, calloc, (size_t u1 UNUSED, size_t u2 UNUSED));
static char tmp_err_buf[768]; static char tmp_err_buf[768];
static char __linker_dl_err_buf[768]; static char __linker_dl_err_buf[768];
#define BASENAME(s) (strrchr(s, '/') != NULL ? strrchr(s, '/') + 1 : s) #define BASENAME(s) (strrchr(s, '/') != NULL ? strrchr(s, '/') + 1 : s)
#define DL_ERR(fmt, x...) \ #define DL_ERR(fmt, x...) \
do { \ do { \
format_buffer(__linker_dl_err_buf, sizeof(__linker_dl_err_buf), \ format_buffer(__linker_dl_err_buf, sizeof(__linker_dl_err_buf), \
"(%s:%d, pid %d) %s: " fmt, \ "%s(%s:%d): " fmt, \
BASENAME(__FILE__), __LINE__, pid, __func__, ##x); \ __FUNCTION__, BASENAME(__FILE__), __LINE__, ##x); \
ERROR(fmt "\n", ##x); \ ERROR(fmt "\n", ##x); \
} while(0) } while(0)
const char *linker_get_error(void) const char *linker_get_error(void)
@ -972,7 +972,7 @@ static int soinfo_relocate(soinfo *si, Elf32_Rel *rel, unsigned count,
reference.. */ reference.. */
s = &symtab[sym]; s = &symtab[sym];
if (ELF32_ST_BIND(s->st_info) != STB_WEAK) { if (ELF32_ST_BIND(s->st_info) != STB_WEAK) {
DL_ERR("cannot locate \"%s\"...", sym_name); DL_ERR("cannot locate symbol \"%s\" referenced by \"%s\"...", sym_name, si->name);
return -1; return -1;
} }