bug-binutils
[Top][All Lists]
Advanced

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

Re: two instances of global from shared lib linked with -Bsymbolic


From: Rafal Dabrowa
Subject: Re: two instances of global from shared lib linked with -Bsymbolic
Date: Wed, 7 Apr 2004 13:05:05 +0200
User-agent: KMail/1.6.1

On Wednesday 07 of April 2004 04:15, Alan Modra wrote:
> On Tue, Apr 06, 2004 at 09:41:10PM -0400, Ian Lance Taylor wrote:
> > Hmmm, yes, for a function that will work, but will it really work for
> > a global variable?  How does it work in the presence of COPY
> > relocations?
>
> I'm not sure.  It would depend on ld.so, I suppose.

OK, this attribute works for variables too. But, is it possible to:
1. have the attribute set by default for functions (e.g. by use a 
compiler/linker option)
2. behave more smart with global variables: if the variable is defined in main 
program also, then two separate instances are created. If the variable is not 
defined in main program (but declared only as "extern"), then only one 
variable instance appears. This should work like function symbols resolution: 
if a function is defined both in library and in main program, then both use 
own function instance. If main program doesn't have own function defined, 
then it uses function from library.

I am compiling a code which is primarily developed under AIX system. AIX 
behaves in this way, and I went into trouble. Is complicated to add such 
possibility in ld program ?


Rafal




reply via email to

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