50

GNU/Linux systems usually use either glibc (Fedora/Redhat family, Arch) or its close cousin, eglibc (Debian/Ubuntu family); since eglibc is now being merged back into glibc (see EGLIBC 2.19 Branch Created under "News"), in the near future they will all be glibc again. The easiest way to check the exact version is to ask ldd, which ships with the C library. ...


48

That library has a main() function or equivalent entry point, and was compiled in such a way that it is useful both as an executable and as a shared object. Here's one suggestion about how to do this, although it does not work for me. Here's another in an answer to a similar question on S.O, which I'll shamelessly plagiarize, tweak, and add a bit of ...


45

It's probably got its regular symbols stripped and what's left is its dynamic symbols, which you can get with nm -D.


32

dlopen isn't a system call, it's a library function in the libdl library. Only system calls show up in strace. On Linux and on many other platforms (especially those that use the ELF format for executables), dlopen is implemented by opening the target library with open() and mapping it into memory with mmap(). mmap() is really the critical part here, it's ...


28

But why does it not do the same until it finds the expected version rather than accepting the first instance of library irrespective of its version? It does, as far as it’s aware. zlib.so.1.2.7 and zlib.so.1.2.8 both have an soname of zlib.so.1, so your alpha and bravo binaries say they need zlib.so.1. The dynamic loader loads the first matching library it ...


20

Let's dive for an answer in random glibc repo in github. This version provides a „banner“ at file version.c: https://github.com/lattera/glibc/blob/a2f34833b1042d5d8eeb263b4cf4caaea138c4ad/csu/version.c In same file there is a few interesting points: __libc_print_version the function that provides printing to stdin same text and symbol __libc_main (void) ...


19

You can use: ldconfig -p | grep libavfilter If there is no output library is not installed. I am not sure if this is 100% reliable. At least in man page of ldconfig for option -p: Print the lists of directories and candidate libraries stored in the current cache.


14

A system isn't actually limited to one C library. Most, though, primarily use only one, which will also be the one the default compiler uses. And since you're downloading source code to compile, that's the one you're concerned with. Start with a trivial program: #include <stdio.h> int main() { printf("Hello, world\n"); return 0; } compile it ...


11

Actually, you can install multiple versions of a shared library if it's done properly. Shared libraries are usually named as follows: lib<name>.so.<api-version>.<minor> Next, there are symlinks to the library under the following names: lib<name>.so lib<name>.so.<api-version> When a developer links against the library ...


11

If you want to know what version is installed, just run: rpm -q libxcb-devel If you want to prevent upgrades to this package, you can add the package to the yum exclude configuration. Add the following to the main section in /etc/yum.conf: exclude=libxcb-devel The library version (e.g., in libxcb.so.1.1.0) very seldom tracks the package version, and is ...


10

The four records have different permissions, so they can't be merged. The r-xp entry describes a block of executable memory (x permission flag). That's the code. The r--p entry describes a block of memory that is only readable (r permission flag). That's static data (constants). The rw-p entry describes a block of memory that is writable (w permission flag)....


10

Android and Linux are two different operating systems. You can't just take an executable from one and run it on the other. The first hurdle is the kernel. Android and Linux are based on the same kernel, but they have a few different features. In particular, Android provides binders, which only exist in the mainstream kernel (the one found in Linux ...


9

The obvious answer, though not the most comprehensive, is to check your package manager, e.g rpm -qi glibc dpkg -l libc6 (Sadly, glibc doesn't have a pkconfig .pc file, so pkgconfig --modversion glibc is a non-runner.) See also @Gnouc's excellent getconf suggestion. The simplest case, with gcc+glibc, and the one I mostly use first is to just execute libc....


8

Software from the distribution is mechanically linked consistently, and expects to find libavcodec.so.54, so the unversioned name isn't required for any of the pre-built packages. If you're building software yourself, however, it's common to use -lavcodec or similar, which will find libavcodec.so unversioned. Similarly, build scripts may expect these names ...


8

It is the Intel Math Library. It contains optimized versions of functions such as sin, pow, etc typically found in libm. It is needed by software built with the intel compiler unless steps were taken to link it statically.


8

System calls are implemented in the kernel, as mentioned in the answer to your followup question. vDSO, the virtual dynamic shared object, is a small virtual library, also implemented by the kernel, which the kernel maps into all processes. Like syscalls it is wrapped by the C library. The main difference between syscalls and the vDSO is one of privilege. ...


8

I don't have the same binary you have but I made a little test and it seems that patchelf can work here. I have a hello binary compiled with -Wl,-rpath=/home/ja/c/hello-puts/make/lib and libtest.so as a dependency: $ ldd hello linux-vdso.so.1 (0x00007ffedb4f0000) libtest.so => /home/ja/c/hello-puts/make/lib/libtest.so (0x00007f04a2437000)...


7

Add the following to your .bashrc: vim ~/.bashrc ... export LD_LIBRARY_PATH=/usr/local/lib This will let you restart your computer, and still have that path assigned.


6

Having multiple versions of a library in the system is not an issue in most Linux distributions: shared libraries with distinct sonames can coexist within the same /usr/lib directory. Moreover, package managers can be instructed to install several such libraries by specifying correct package names: apt-get install libjpeg7 apt-get install libjpeg8 In ...


6

@PSkocik answered this. I just want to add more detail. There are two kinds of symbol sections in ELF: .symtab and .dynsym (see the Linux Standard Base Core Specification, a.k.a. LSB_5.0.0, for details). .symtab is for the linking step of the shared lib itself. Once linking is finished, the .symtab section is not needed anymore. The .dynsym section contains ...


6

Commentary on YUM & deps YUM does do this. But it's only as good as the RPM specifies. In this case your RPM states that it'll work with any GLIBC > 2.13 but it clearly was built with a specific version of GLIBC, and will only work if the appropriate GCC symbols are available on the system: $ rpm -qpR trillian-6.1.0.5-1.fc25.x86_64.rpm atkmm >= 2.22....


5

(This is essentially the same as goldilocks' answer but with some more explanation of what is going on under the hood.) The core shared library for GNU libc, libc.so.6 (on Linux; Hurd has a different SONAME), has the unusual property (for shared libraries) that you can invoke it as an executable. If you do, it prints out the sort of thing GNU utilities ...


5

Another way to get it: getconf GNU_LIBC_VERSION


5

GNU libc (what most Linux distributions use in one form or the other) goes to great lengths to keep strict backwards compatibility. So you should run into trouble only if you try to run a too-new binary on an old version (or a "enterprise" distribution, they normally freeze versions, particularly foundation ones like the C library, backporting fixes while ...


5

dlopen has nothing to do with shared libraries as you think of them. There are two methods of loading a shared object: You tell the compile-time linker (ld, though usually it's called through the compiler) that you want to use functions from a particular shared library. With this approach, you must know what the name of the library will be at when the ...


5

The firefox executable is a shell script on your system. Some applications employ a wrapper script that sets up the execution environment for the application, possibly to allow for better integration with the current flavor of Unix, or to provide alternative ways to run the application (new sets of command line options etc.) that the application itself is ...


4

I have a few ways to do this, easy ones first: Making the install prefix flexible is hard - I would just make the install prefix to your home directory, or somewhere that you can access on any of the machines, and use make install DESTDIR=/path/to/place/where/binaries/should/be/installed to install them to somewhere other than the prefix. I personally ...


4

That's a roundabout and grossly inaccurate method. You know the location of the library file, so you don't need to use heuristics to match it, you can search for the exact path. There's a very simple way to list the processes have a file open: fuser /lib/x86_64-linux-gnu/libc.so.6 However this lists the processes that have the current version of the file ...


4

Look in /usr/lib and /usr/lib64 for those libraries. If you find one of the ones ffmpeg is missing, symlink it so it exists in the other directory. You can also run a find for 'libm.so.6' and see where that file is at. There is a good chance ffmpeg is looking in the same directory for the missing ones. Symlink them over there once you find them. If they ...


4

This functionality is not disallowed, it is just not very common as a result of the way most libraries numbering work and because of the inconvenience of package name changes. If the use a dotted version number scheme X.Y.Z. The "micro" version Z often changes on bugfixes, the "minor" number Y changes on backward compatible changes and the "major" version ...


Only top voted, non community-wiki answers of a minimum length are eligible