This is the mail archive of the binutils@sourceware.org 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: Linker version script turning weak symbols into strong symbols


Kevin P. Fleming wrote:
> Dave Korn wrote:
> 
>>   I'd better add a disclaimer here that the behaviour of the ELF runtime
>> linker is at the edge of my knowledge, but if, as you say, symbol resolution
>> has been run on test2 when it was loaded and will not be run again when test3
>> is loaded yet you want test2 to know that a defintion of foo has now been made
>> available, aren't you just going to have to dlsym() it?
> 
> (Thanks for your generous help on this issue so far... it's been good to
> talk to someone who actually understands this stuff!)

  But do be warned, we're at the limits of what I'm confident I understand
properly.  I've been studying up on weak symbols a lot lately, but when I get
into the realm of the runtime loader it's further than I needed to go in
detail for the purposes I was studying them for.

> No, if test2 is loaded before test3, we don't expect it to become aware
> of test3 being loaded (and in the real world application of this, this
> would only occur because the system admin has chosen not to *ever* load
> test3). We just want test2 to be able to behave appropriately when test3
> is not loaded, and I was hoping to be able to use these existing linker
> mechanisms to implement that as opposed to building my own solution.

  So does the weak-symbol-plus-alias solution work for you just so long as you
/don't/ declare the symbol local?

    cheers,
      DaveK


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