I am writing some software that uses libsimavr.so. Because it runs in a rather special environment, it loads the library at run-time, using dlopen(). That fails either immediately or later when calling dlsym(), depending on the dlopen() flags. On examining the library with ldd, the cause is clear: libsimavr.so is not linked with the libraries it depends on, particularly libelf.
Looking in Makefile.common, the "-l" options are explicitly removed when linking shared libraries.
I tried restoring them, and all seems well: tests and exampes work as before and dlopen() now works. What is the reason for omitting the library dependencies?