On Tue, 9 Dec 2025 at 14:01, Bruno Haible <[email protected]> wrote: > > Thanks. I am adding it, with > - fixed indentation in relocatable.c, > - moving the added block of _GL_* definitions up, > - systematic m4 quoting even of single words in m4 code, > - and a GNU-style ChangeLog entry. >
Thanks for the improvements. Then I notice that > - m4/libdl.m4 is missing from modules/relocatable-lib-lgpl, > Bother, sorry! - Testing with > ./configure --enable-relocatable CFLAGS="-DPIC > -DINSTALLDIR=\\\"/tmp\\\" -DENABLE_COSTLY_RELOCATABLE" > on AIX, I get a compilation error: > I see that someone has made an apparently partial implementation of dladdr for AIX: https://root.cern.ch/d/blog/aix-and-dladdr.html > This is because AIX has <dlfcn.h> but does not have dladdr(). > I guess that means we need to guard the use of dladdr against AIX? Given that it's now standardized, one can hope that the number of systems that have dlopen but not dladdr will not grow. Or should we actually test explicitly for this function in configure.ac? The next question is: How costly is this dladdr() call? Would it therefore > make sense to enable ENABLE_COSTLY_RELOCATABLE by default on more > platforms? > I don't know. I had a quick look at the source for glibc, which seems to involve linear scans of a) a linked list and b) the buckets of a hash table, but I have no idea how big those lists are. I was wondering before about doing some testing with perf, but I'm a novice here; does perf even count instructions executed before main? The implementation I linked for AIX above seems to be similar: a linear scan through a linked list. Again, I would guess that the main BSDs would have similar implementations. -- Web: rrt.sc3d.org
