[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


From: John Calcote
Subject: Re: Problems with LTDL_SET_PRELOADED_SYMBOLS
Date: Fri, 13 Mar 2009 13:35:48 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1b3pre) Gecko/20090223 Thunderbird/3.0b2

Never mind - I just discovered that the symbol in question is generated within the embedding executable, not the ltdl library. Sorry for the trouble.


On 3/13/2009 12:31 PM, John Calcote wrote:
Hi all,

I'm trying to write a little test program that uses ltdl from Libtool 2.2.6. Now this package comes preinstalled with OpenSuSE 11.1, which is a fairly significant upgrade from OpenSuSE 11.0, which shipped with Libtool 1.5.

Both the older and newer ltdl package are installed on this sytsem - libltdl-3-1.5.26 and libltdl7-2.2.6 but I know I'm linking to the correct library, but I get an undefined symbol error:

$ ls -al /usr/lib64/libltdl*
... /usr/lib64/libltdl.a
... /usr/lib64/
... /usr/lib64/ ->
... /usr/lib64/ ->
... /usr/lib64/
... /usr/lib64/ ->
... /usr/lib64/

$ make
libtool: link: gcc -g -O2 -o .libs/jupiter jupiter-main.o  ../libjup/.libs/ /usr/lib64/ -ldl -lpthread
jupiter-main.o: In function `main':
/home/jcalcote/dev/prj/autotools/jupiter-libtool-ch7/src/main.c:25: undefined reference to `lt__PROGRAM__LTX_preloaded_symbols'

I did a little digging: This line in the ltdl.h header file is causing LTDL_SET_PRELOADED_SYMBOLS to reference the undefined symbol:

#define lt_preloaded_symbols    lt__PROGRAM__LTX_preloaded_symbols
#define LTDL_SET_PRELOADED_SYMBOLS()                    LT_STMT_START{  \
        extern const lt_dlsymlist lt_preloaded_symbols[];               \
        lt_dlpreload_default(lt_preloaded_symbols);                     \

Yet, when I use objdump -T on the library, I only see this symbol:

$ objdump -T /usr/lib64/ | grep LTX_pre
0000000000208da0 g    DO   0000000000000040  Base        lt_libltdl_LTX_preloaded_symbols

If I add the following definitions to my program:

# include <ltdl.h>
# undef lt_preloaded_symbols
# define lt_preloaded_symbols lt_libltdl_LTX_preloaded_symbols

Then the program links without errors, and runs correctly. It appears that the 2.2.6 header file is out of alignment with the ltdl 2.2.6 library. Is this a defect in libtool 2.2, or a problem with the OpenSuSE 11.1 distro ltdl 2.2.6 package?

One more note on this issue - if I configure with --disable-shared, then my library isn't in my preloaded symbol table anyway - at least I don't see it when walking the list in gdb. So, I'm guessing that my hack was inaccurate, at best. It appears that the 2.2.6 version of libltdl doesn't export the preloaded symbol list.

Thanks in advance,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]