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

hb end.of at inter.net
Wed Sep 28 17:08:15 EDT 2022


On 9/28/22 7:35 PM, Johnny Billquist wrote:
> 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.
>>
> 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.

On VMS (all platforms except VAX) you would link the shareable image
once with all the symbols in the global symbol table (GST), which you
need when linking images and which do not exhibit the multiply defined
warning. For linking those images you would re-link the shareable and
exclude the multiply defined symbols from the GST, that is make them
"private" in the symbol vector option. Once linking is complete, any of
the shareable images can be used at run time. Obviously you need an
identical GSMATCH option when linking both shareable images.

To me this approach looks like more work/adjustments in the build
process than the previously suggested solution.




More information about the Info-vax mailing list