3 ms·
I don't know what it means in the context of this tool, but library searching is much more complicated than a single environment variable. There is the system
by georgyo 2y ago
I don't know what it means in the context of this tool, but library searching is much more complicated than a single environment variable.
There is the system search path, runpath, rpath, and LD_LIBRARY_PATH as just a few different distinct methods library searched on directories.
Libraries are also usually linked just by the short name, IE foo.so, but they can also be dynamically linked to the full path of the library.
Side note, as a general rule if you can avoid setting the LD_LIBRARY_PATH you'll be much off. It's not always possible, but setting puts it at the top of the search for all executions. Even if something dynamically links the full path to a library, LD_LIBRARY_PATH will take precedence. It completely flattens the search.
- wpollock 2y agoOn top of that, libraries can be linked by their SONAME and not the file name. (This is rarely done however.)
- cylemons 2y agoI thought dynamic linking always uses the soname
- bregma 2y agoStatic linking uses the DT_SONAME of a linked library to create an entry in the DT_NEEDED table. The name in the DT_NEEDED table is used by the dynamic loader to search for a matching filename to load in. So in a very indirect sense the dynamic loader always uses the SONAME that was supplied at build time, but it also uses a search algorithm to find that filename at load time.
- account42 2y agoThe SONAME is the filename used for runtime linking. On the filesystem it may or may not be a symlink but that does not concernt the linker. It may not be (and usually isn't) the same filemame used when bulding the binary. This is because the SONAME is meant to specify a specific ABI version of the library.