This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: mipsel-linux and --export-dynamic

On Thu, Nov 04, 2004 at 12:51:02PM +0100, Thomas Lopatic wrote:
> Hi there,
> I've compiled binutils 2.15 on an Intel Linux platform with a target of 
> mipsel-linux ("./configure --target=mipsel-linux"). I am using this 
> build to link objects generated by a cross-plattform GCC. My problem is 
> that all external symbols end up in the dynamic symbol table (verified 
> with "objdump --dynamic-syms"), although I do not pass 
> "--export-dynamic" to the linker.
> The problem with this is that I have an executable and shared objects 
> loaded by this executable that have conflicting symbols, i.e. some 
> symbols appear in the executable as well as in the shared objects. So, 
> if an external variable "x" appears in the executable and in a shared 
> object, both access the same memory location. I would, however, prefer 
> everyone to have his own copy of "x". (Because otherwise the program 
> crashes. :-D)

If you need this behavior, then you should be marking "x" as a hidden
symbol - see the visibility attribute in the GCC manual.

> Working around the problem by renaming the symbols in the shared objects 
> or the executable to remove the overlaps or making the affected 
> variables static would be possible in my case. However, I'd prefer the 
> linker to behave as expected. Or is there something that I am missing?

I think this is one of the many quirks of MIPS ELF.

Daniel Jacobowitz

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]