https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88054
Martin Liška <marxin at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://sourceware.org/bugz | |illa/show_bug.cgi?id=14932 --- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> --- The issue with dlvsym is that one can't request a default version (without knowing ABI version), so e.g. dlvsym(h, "fopen", ""). I believe root problem is this glibc PR I just linked. The problem is default version is not returned. I wrote a script that lists all function names for which interceptor is called (GetRealFunctionAddress) and I compared that to symbols in glibc that have multiple interface versions. And the result is not good: $ readelf --syms --wide /lib64/libc.so.6 | ./check-symver.py ['glob64@@GLIBC_2.27', 'glob64@GLIBC_2.2.5'] ['glob@@GLIBC_2.27', 'glob@GLIBC_2.2.5'] ['sched_getaffinity@@GLIBC_2.3.4', 'sched_getaffinity@GLIBC_2.3.3'] ['realpath@@GLIBC_2.3', 'realpath@GLIBC_2.2.5'] ['fmemopen@@GLIBC_2.22', 'fmemopen@GLIBC_2.2.5'] ['memcpy@@GLIBC_2.14', 'memcpy@GLIBC_2.2.5'] $ readelf --syms --wide /lib/libc.so.6 | ./check-symver.py ['scandir64@@GLIBC_2.2', 'scandir64@GLIBC_2.1'] ['glob64@@GLIBC_2.27', 'glob64@GLIBC_2.1', 'glob64@GLIBC_2.2'] ['getpwent_r@@GLIBC_2.1.2', 'getpwent_r@GLIBC_2.0'] ['getpwuid_r@@GLIBC_2.1.2', 'getpwuid_r@GLIBC_2.0'] ['getgrnam_r@@GLIBC_2.1.2', 'getgrnam_r@GLIBC_2.0'] ['shmctl@@GLIBC_2.2', 'shmctl@GLIBC_2.0'] ['getgrent_r@@GLIBC_2.1.2', 'getgrent_r@GLIBC_2.0'] ['glob@@GLIBC_2.27', 'glob@GLIBC_2.0'] ['__lxstat64@@GLIBC_2.2', '__lxstat64@GLIBC_2.1'] ['fclose@@GLIBC_2.1', 'fclose@GLIBC_2.0'] ['gethostbyaddr_r@@GLIBC_2.1.2', 'gethostbyaddr_r@GLIBC_2.0'] ['realpath@@GLIBC_2.3', 'realpath@GLIBC_2.0'] ['gethostbyname_r@@GLIBC_2.1.2', 'gethostbyname_r@GLIBC_2.0'] ['getpwnam_r@@GLIBC_2.1.2', 'getpwnam_r@GLIBC_2.0'] ['readdir64@@GLIBC_2.2', 'readdir64@GLIBC_2.1'] ['__xstat64@@GLIBC_2.2', '__xstat64@GLIBC_2.1'] ['gethostbyname2_r@@GLIBC_2.1.2', 'gethostbyname2_r@GLIBC_2.0'] ['getgrgid_r@@GLIBC_2.1.2', 'getgrgid_r@GLIBC_2.0'] ['fopen@@GLIBC_2.1', 'fopen@GLIBC_2.0'] ['fmemopen@@GLIBC_2.22', 'fmemopen@GLIBC_2.2'] ['readdir64_r@@GLIBC_2.2', 'readdir64_r@GLIBC_2.1'] ['fopencookie@@GLIBC_2.2', 'fopencookie@GLIBC_2.0'] ['gethostent_r@@GLIBC_2.1.2', 'gethostent_r@GLIBC_2.0'] ['fdopen@@GLIBC_2.1', 'fdopen@GLIBC_2.0'] ['sched_getaffinity@@GLIBC_2.3.4', 'sched_getaffinity@GLIBC_2.3.3']