Re: How to make gcc give a check about symbol conflicts in shared libraries it links?

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

 



"xiaxia347work"<xiaxia347work@xxxxxxx> writes:

>      I got a tricky problem when I link my exe program with 2 shared libraries,
>  the global variable with same name in the  2 .so file may be linked to the same
>  address, resulting problem that is hard to find.  

This is not a gcc issue.

You didn't mention which OS you are using.  I will assume it is
GNU/Linux.  On GNU/Linux, or any other ELF based system, there is a
single global namespace of global variables and functions.  When two
shared libraries use the same global variable name, they are referring
to the same variable.  This is a feature.

If you want something different to happen, look into symbol visibility
and linker version scripts.

Ian


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux