[Info-vax] Linking problem with multiply defined symbols, how to resolve?
Johnny Billquist
bqt at softjar.se
Fri Sep 30 10:25:31 EDT 2022
On 2022-09-28 23:08, hb wrote:
> 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.
Maybe I wasn't paying attention. I don't think I've seen a previous
suggested solution that applies to VMS. And the solution for Unix from
which this started is questionable how well it actually works (not
entirely clear *which* symbol would in the end be the one your
application would resolve to).
Johnny
More information about the Info-vax
mailing list