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

hb end.of at inter.net
Sun Oct 2 04:56:18 EDT 2022


On 10/1/22 21:13, Richard Levitte wrote:
> fredag 30 september 2022 kl. 19:39:03 UTC+2 skrev hb:
>> The linker processes input files in cluster order. With object modules
>> on the command line or in the options file, the object module is
>> collected into the "DEFAULT_CLUSTER". Any shareable image specified in
>> the options file is put in its own cluster (it's shareable image name)
>> in the order of the options file, no matter if it is selectively
>> processed or not. All such "user defined" clusters are put into the
>> cluster list before the default cluster.
> 
> That last bit, "before the default cluster", is the bit that escaped me, obviously.  I don't see that clearly in the manual, quite the contrary when I read this, for example (third paragraph of 2.3.1, emphasis of "after" mine):
> 
>> Clusters for shareable images, specified in shareable image libraries, appear /after/ the default cluster
>> on the cluster list because they are created later in linker processing, when the linker knows which
>> shareable images in the library are needed for the link operation.

This is for libraries, for example IMAGELIB.OLB, which contains 
DECC$SHR.EXE, etc.

In the previous paragraph it is said: "The linker may create additional 
clusters, called named clusters, depending on the types of input files 
you specify and the linker options you specify. If it creates additional 
clusters, the linker places them on the cluster list ahead of the 
default cluster, in the order in which it encounters them in the options 
file."

And in Table 2.2. Linker Input File Cluster Processing, there is

Shareable image file (.EXE)  - Always placed in a named cluster.

and

Library files (.OLB) - ... However, the linker puts shareable images 
referenced from IMAGELIB.OLB into new clusters at the end of the cluster 
list (after the default cluster).

Could the documentation be made clearer? It looks like.

Have a look at a full map of a hello-world type C program. You will see 
the DECC$SHR after the DEFAULT_CLUSTER.

If you link /NOSYSSHR and add SYS$SHARE:DECC$SHR/SHARE (and 
SYS$SHARE:SYS$PUBLIC_VECTORS/SHARE) you will find the named clusters 
before the DEFAULT_CLUSTER.

You can have your own shareable image library. Put whatever shareable 
image you need into the library. The one(s) with the same symbol(s) as 
defined in the object module(s) need to be selectively processed. Then 
add that image library to your command line.

For my example the commands are

$ libr /cre/share shrlib foo/sel
$ link bar,shrlib/lib
$

That should work as well.



More information about the Info-vax mailing list