help-gnu-utils
[Top][All Lists]
Advanced

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

Runtime Linker and friends.


From: Tristan Van Berkom
Subject: Runtime Linker and friends.
Date: Thu, 25 Mar 2004 14:28:04 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225

Hi all you gnu folks ;-)

    I've been having a hard time finding any linker gurus on this
planet... so I'll try a related question here and hope for the best.


I'm trying to get an application to link against a library that
references a global variable declared by the application in question.


Basicly, I have a (C) header file that does:
=====================
#if MASTER_OBJECT
int __symbol_name = 0;
#endif MASTER_OBJECT

extern __symbol_name;
=====================

So the principal is that only one `__symbol_name' must be present per
application, but all objects compiled in (shared/nonshared) should have
access to it.

So this is where I run into trouble:
====================================

I get this message from the runtime linker:
"./application: error in loading shared libraries: /usr/lib/library.so:
undefined symbol: __symbol_name"

If I run `nm' on `application' I get:
080557dc D __symbol_name

which means that the symbol is *present* in the initialized data section.

If I run `nm' on the library, I get:
         U __lckname_resolved

which means that it is undefined and must be resolved by the runtime
linker.

Now the way I see it; the symbol is provided only once and referenced
many times by many stubs, thats usual.

So is there anyone a little less clueless than me here ?

TIA/Regards,
                                        -Tristan






reply via email to

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