You are not logged in.
Hey all, I'm coming over from Debian and am trying to understand some of the fundamental differences between Arch and Debian. For example, systemwide libraries are stored in different places. When moving binaries between distros, I'd like to know how the linker on Arch knows where to look for system-installed libs. Where are the actual paths to /lib and /lib64 stored that the dynamic linker uses for its search? Any help is appreciated!
Offline
When moving binaries between distros...
Ah, what? Don't do that.
Where are the actual paths to /lib and /lib64 stored that the dynamic linker uses for its search?
Both are links to /usr/lib/
Last edited by Trilby (2023-03-21 04:12:22)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Both are links to /usr/lib/
Right, I get that. But the dynamic linker needs to know what the paths are. This can be overridden with LD_LIBRARY_PATH, but I would like to know where the default paths are stored. In other words, what text file on the system contains the default paths?
Offline
inside the linker itself.
Offline
inside the linker itself.
Oh, really? The library paths are hard-coded into the linker? Is there a way of getting it to print its default paths?
Offline
I think I figured it out:
# Print 32 bit lib paths
/lib/ld-linux.so.2 --help
# Print 64 bit lib paths
/lib/ld-linux-x86-64.so.2 --help
Compiling with gcc with -m64 outputs a binary that links with /usr/lib/libc.so.6. Doing the same using -m32 links with /usr/lib32/libc.so.6.
That's what I needed to know!
Last edited by Phaserblast (2023-03-21 04:45:40)
Offline