This is to discuss a possible improvement to ldd, a tool used to check
the linkage of a dynamically linked library or an executable.
(Apologies, if this should go to a different list - do tell me which one)
While on Linux and Solaris (the latter from vague memories) an
unresolved link is duly printed by ldd (and this is very helpful while
debugging linking issues), and the same is true for its
macOS' rough equivalent otool, on OpenBSD ldd just errors out like this:
$ ldd semigroups.so
semigroups.so:
Cannot load specified object
semigroups.so: exit status 1
If I tell it to look in a non-standard location, like this, it works:
$ LD_LIBRARY_PATH=/home/dima/lib ldd semigroups.so
semigroups.so:
Start End Type Open Ref GrpRef Name
00000c2788ba5000 00000c278abbd000 dlib 2 0 0
/home/dima/tmp/gap/pkg/semigroups/bin/x86_64-unknown-openbsd7.3-default64-kv9/semigroups.so
00000c26d469a000 00000c26d477e000 rlib 0 2 0
/usr/lib/libc++.so.9.0
00000c277637d000 00000c27763c3000 rlib 0 3 0
/usr/lib/libc++abi.so.6.0
00000c26dabd7000 00000c26dad78000 rlib 0 1 0
/home/dima/lib/libsemigroups.so.2.0
Would there be interest in improving ldd on OpenBSD in this aspect?
I.e. I'd much like to see, instead of:
$ ldd semigroups.so
semigroups.so:
Cannot load specified object
something like:
$ ldd semigroups.so
semigroups.so:
Start End Type Open Ref GrpRef Name
00000c2788ba5000 00000c278abbd000 dlib 2 0 0
/home/dima/tmp/gap/pkg/semigroups/bin/x86_64-unknown-openbsd7.3-default64-kv9/semigroups.so
00000c26d469a000 00000c26d477e000 rlib 0 2 0
/usr/lib/libc++.so.9.0
00000c277637d000 00000c27763c3000 rlib 0 3 0
/usr/lib/libc++abi.so.6.0
00000c26dabd7000 00000c26dad78000 rlib 0 1 0
libsemigroups.so !!!UNRESOLVED!!!
Printing out info on the "specified object" which cannot be resolved would
already be an improvement.
Best,
Dima