On Sat, Nov 16, 2002 at 12:34:43AM +0900, Akira TAGOH wrote: > >>>>> On Fri, 15 Nov 2002 13:27:49 +0100, > >>>>> "BA" == Bill Allombert <[EMAIL PROTECTED]> wrote: > > BA> You need to link your executable binary with -export-dynamic: > BA> man ld: > BA> -export-dynamic > BA> When creating an ELF file, add all symbols to the > BA> dynamic symbol table. Normally, the dynamic symbol > BA> table contains only symbols which are used by a dy > BA> namic object. This option is needed for some uses > BA> of dlopen. > > No, it doesn't help. > try this case: > > ---Makefile > t-static: t.c libfoo.a > gcc -static -export-dynamic -o $@ $< -L. -lfoo -ldl >
Wait a minute, -export-dynamic is an option to *ld* not to gcc! Rewrite this line as t-static: t.c libfoo.a gcc -Xlinker -export-dynamic -o $@ t.c libfoo.a -L. -ldl % rm ./t-static; make % ldd ./t-static libdl.so.2 => /lib/libdl.so.2 (0x40019000) libc.so.6 => /lib/libc.so.6 (0x4001e000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000) % make test yellowpig% make test LD_LIBRARY_PATH=. ./t-shared test. test.: test.: LD_LIBRARY_PATH=. ./t-static test. test.: test.: Anyway, if it is a bug in dlopen() or in some Makefile, then it is not a bug in policy. Cheers, Bill