[Info-vax] Linking problem with multiply defined symbols, how to resolve?

Johnny Billquist bqt at softjar.se
Wed Sep 28 13:35:38 EDT 2022


On 2022-09-28 17:24, Stephen Hoffman wrote:
> On 2022-09-28 07:33:58 +0000, Richard Levitte said:
> 
>> I have this problem, that I want to build an app or a shareable image, 
>> which is linked with another shared library, but which also implements 
>> its own variant of symbols that are defined in that other shared library.
>>
>> This is intentional.  It works absolutely fine to do this on the 
>> Unixen I've access to, as well as on Windows...  but VMS fails me.
> 
> It's not so reliable on various Unix systems; the results can entail 
> indeterminate behavior even on some Unix systems, based on an error 
> message I've met.

I was going to ask how you'd know which library you then get the symbol 
from in the end in your application. Seems a fair risk you might end up 
with the wrong one if you don't have more explicit control.

> On OpenVMS, I have a tool Shimmer, which creates a new shareable image 
> from an existing shareable image, and that allows interception of 
> selected (or all) calls in the shareable image. I open-sourced this tool 
> a while back, and probably still have a copy of it around. If you're 
> interested in this interception, let me know and I'll poke around for a 
> copy.
> 
> Otherwise, you're going to need to have some better hygiene around your 
> symbols, which usually means some combination of building shareable 
> images and using selective search qualifier, or maybe dynamic activation 
> of the shareable image you want with the symbol you want at run-time 
> using lib$find_image_symbol, this if linker clusters mentioned earlier 
> don't get you where you need.

Not sure if this is helpful or not, but just to give an idea of what 
could be something to look for.

In RSX, you would link the shareable library and list symbols you want 
to be excluded from the symbol table (or overridden) of the shared 
library. Mainly in order to not get symbol conflicts (that can happen 
quite a lot otherwise, since external symbols in RSX are only 6 
characters long in the first place).

However, that trick is not possible to use on plain object files.

   Johnny



More information about the Info-vax mailing list