Bruno Haible <br...@clisp.org> writes: >> > I wish the list of libraries that support this mechanism was >> > not hard-coded. Do you have an idea for making it >> > extensible? >> >> It is not clear to me why this mechanism is here. I guess that >> it must be to avoid the need for the caller to also call the >> individual lib<name>_set_relocation_prefix functions directly. > > Yes, exactly. Assume a program links to libgettextpo. libgettextpo > may or may not be linked to libunistring. libunistring may or may > not be linked to libiconv. libgettextpo may or may not be linked > to libintl. => I cannot imagine the horrible #ifdef combinations > that result from the attempt to call the lib<name>_set_relocation_prefix > functions directly.
I was imagining that the program would call the functions for any library that it uses itself, say libX. If libX uses libY, then libX_set_relocation_prefix() calls libY_set_relocation_prefix(), and so on. > Probably the best is to use dl_iterate_phdr on glibc and Solaris systems, > _dyld_get_image_name on MacOS X, loadquery on AIX, shl_get on HP-UX, > ldr_inq_module on OSF/1, VirtualQuery on Woe32. To me this sounds pretty horrible too. -- I love deadlines. I love the whooshing noise they make as they go by. --Douglas Adams