Hi,
This small patch to readelf.c displays the library name from which a dynamic symbol of specific version should be resolved.
===== diff --git a/src/readelf.c b/src/readelf.c index 5255860..c8c37f0 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -2068,9 +2068,11 @@ handle_symtab (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr)
if (vernaux != NULL && vernaux->vna_other == *versym) { - printf ("@%s (%u)", + printf ("@%s %s (%u)", elf_strptr (ebl->elf, verneed_stridx, vernaux->vna_name), + elf_strptr (ebl->elf, verneed_stridx, + verneed->vn_file), (unsigned int) vernaux->vna_other); check_def = 0; } =====
Sample output: (edited to fit in space) looks like
===== $ ./readelf -s ar
0: ... DEFAULT UNDEF 1: ... DEFAULT UNDEF __errno_location@GLIBC_2.0 libc.so.6 (2) 2: ... DEFAULT UNDEF gelf_getsym@ELFUTILS_1.0 libelf.so.1 (3) 3: ... DEFAULT UNDEF basename@GLIBC_2.0 libc.so.6 (2) 4: ... DEFAULT UNDEF elf_strptr@ELFUTILS_1.0 libelf.so.1 (3) 5: ... DEFAULT UNDEF sysconf@GLIBC_2.0 libc.so.6 (2) 6: ... DEFAULT UNDEF memcmp@GLIBC_2.0 libc.so.6 (2) 7: ... DEFAULT UNDEF open64@GLIBC_2.1 libc.so.6 (4) 8: ... DEFAULT UNDEF elf_getdata@ELFUTILS_1.0 libelf.so.1 (3) 9: ... DEFAULT UNDEF __fsetlocking@GLIBC_2.2 libc.so.6 (5)
...
=====
I would really appreciate it if it gets accepted for the main branch, as that'll be a lot of help to me.
Thank you. -- Regards - Prasad