Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support linker files #7

Open
mchristianl opened this issue Nov 4, 2018 · 1 comment
Open

support linker files #7

mchristianl opened this issue Nov 4, 2018 · 1 comment
Labels

Comments

@mchristianl
Copy link

Hi there,
During the build of the archlinux aur/julia-git package I've encountered the following issue:

./libwhich -p libm.so
failed to open library: /usr/lib/libm.so: invalid ELF header

And indeed, I have

file /usr/lib/libm.so
/usr/lib/libm.so: ASCII text

On this site it is claimed, that

.so files are not designed to be loaded, but to be used at link time.
Therefore it's perfectly fine for them to be a linker file.

What is should be the correct behaviour here?

strace -e openat ./libwhich -p libm.so
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/tls/x86_64/x86_64/libm.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/usr/lib/tls/x86_64/libm.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/usr/lib/tls/x86_64/libm.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/usr/lib/tls/libm.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/usr/lib/x86_64/x86_64/libm.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/usr/lib/x86_64/libm.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/usr/lib/x86_64/libm.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/usr/lib/libm.so", O_RDONLY|O_CLOEXEC) = 3
failed to open library: /usr/lib/libm.so: invalid ELF header
+++ exited with 1 +++
@vtjnash
Copy link
Owner

vtjnash commented Mar 19, 2019

The goal of this package is to show you what would happen if you called dlopen on the string given as the command line argument. Since linux's behavior is to fail, that's the intended behavior here too.

@vtjnash vtjnash added the doc label Jun 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants