From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <98077918816648.tru64-unix-managers.marc@archive.invalid> From: Arno Hahma Date: Mon, 29 Jan 2001 14:43:08 +0000 To: tru64-unix-managers Subject: SUMMARY: dlopen() cannot follow shared libraries X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=98077918816648 Thank you for both Dr. Toms (does the name Thomas imply in depth knowledge of Tru64 unix? ;-) for helping to solve the problem! The problem is not with dlopen, but in the way how shared libraries are used. The problem was, that dlopen didn't find symbols in a shared library linked by another shared library. As Dr. Blinn points out, it has to be known at the invocation time of dlopen(), where the symbols are defined. Thus, if you dlopen() a shared module, which references another shared module, care must be taken to load the modules in such an order, that dependencies are resolved before the second dlopen(). Apparently, shared libraries are only scanned once, which makes it difficult to design the dynamic modules in a way, that all interdependencies are resolved correctly. This is how it is supposed to work, you only load what you need when you need it, not everything. This was also the case with Apache using php4 AND mmap_static.so (module mmap'ing other stuff to memory to speed things up). Either one or the other has to be left out, or linked in statically to make it work. Dr. Leitner provided me with a working combination of "./configure" -settings to make things work. However, as I needed to use the mmap_static -module, there wasn't much more to do than statically link the php4.a into apache (or vice versa). The only tradeoff of this was increased memory consumption. In this case, memory is much cheaper than all the time consumed on changing the code to do it dynamically. They _do_ say in Apache documentation, that the mmap_static -module is _experimental_, albeit a working one. ArNO 2