public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Same symbol in more then one shared library
@ 2003-03-18 17:52 Ajay Bansal
  2003-03-20 19:24 ` LLeweLLyn Reese
  0 siblings, 1 reply; 2+ messages in thread
From: Ajay Bansal @ 2003-03-18 17:52 UTC (permalink / raw)
  To: gcc-help

Hi All

I have a class "CriticalSection" in one of my shared libs. My
Application is linked to many thirdparty libs. 

Now, if the class name is CriticalSection, objects are created but the
constructor of my code is not invoked. That suspicously points to the
fact that object of some other class with name "CriticalSection" is bein
created. (If I change the name of my class to some other name, say
MyCriticalSection, code works fine)

Now is there some way to tell from which particular shared lib, a symbol
is being picked up??? That way I'll which library is the culprit. I
tried using "nm" to find the shared lib, but have not been able to do so
successfully? 

Is it possible that some system library has a class with name Critical
Section???


-Ajay


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Same symbol in more then one shared library
  2003-03-18 17:52 Same symbol in more then one shared library Ajay Bansal
@ 2003-03-20 19:24 ` LLeweLLyn Reese
  0 siblings, 0 replies; 2+ messages in thread
From: LLeweLLyn Reese @ 2003-03-20 19:24 UTC (permalink / raw)
  To: Ajay Bansal; +Cc: gcc-help

"Ajay Bansal" <Ajay_Bansal@infosys.com> writes:

> Hi All
> 
> I have a class "CriticalSection" in one of my shared libs. My
> Application is linked to many thirdparty libs.

It seems likely to me that one of your thirdparty libs contians a
    CriticalSection symbol.

> 
> Now, if the class name is CriticalSection, objects are created but the
> constructor of my code is not invoked. That suspicously points to the
> fact that object of some other class with name "CriticalSection" is bein
> created. (If I change the name of my class to some other name, say
> MyCriticalSection, code works fine)
> 
> Now is there some way to tell from which particular shared lib, a symbol
> is being picked up???

I think you may be able to discern this from a map file. Read the docs
    on how to make your linker generate a map file. If gnu ld is your
    linker, I believe -Wl,-M will do the trick.

Please read:
http://gcc.gnu.org/onlinedocs/gcc-3.2.2/gcc/Link-Options.html#Link%20Options
    and scroll to the bottom of the page.

Please read:
http://sources.redhat.com/binutils/docs-2.12/ld.info/Options.html
    and search for '--print-map' .
    

> That way I'll which library is the culprit. I
> tried using "nm" to find the shared lib, but have not been able to do so
> successfully? 
> 
> Is it possible that some system library has a class with name Critical
> Section???

I think so, but I think a thirdparty lib is more likely the culprit.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-03-20 19:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-18 17:52 Same symbol in more then one shared library Ajay Bansal
2003-03-20 19:24 ` LLeweLLyn Reese

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).