Reputation: 8497
I know I can get the version of some linux shared libraries just by running it. e.g.
bash$ /lib/x86_64-linux-gnu/libc.so.6
GNU C Library (Ubuntu GLIBC 2.23-0ubuntu9) stable release version 2.23, by Roland McGrath et al.
I also can get the loaded shared libraries programmatically in a running process using dl_iterate_phdr(3).
How can I get the version information programmatically?
Upvotes: 0
Views: 1097
Reputation: 1028
Maybe this will help: https://unix.stackexchange.com/questions/58846/viewing-linux-library-executable-version-info
Basically, ELF contains field SONAME which tells the library name with the major version.
Upvotes: 1