Silverfrost Forums

Welcome to our forums

Use of VIRTUALCOMMON

4 Aug 2015 4:22 #16688

I have inherited a suite of programs all of which use:

VIRTUALCOMMON 0x30000000

in their link files. These programs have been distributed to customers for years without problems, until the last 6 months where we have had to change the address to 0x2... to avoid a clash with other programs. The developer who originally produced the linker files has long since gone, so I wonder if someone could enlighten me as to the need for this linker option and what might be the outcome if it is removed ? (It runs fine without it on our dev. machine).

Many thanks.

5 Aug 2015 12:42 #16694

Here is an extract from the help file on this subject...

It is possible in most languages (and in particular in Fortran and C/C++) to have uninitialised global data, for example, a common block in Fortran not initialised with a BLOCK DATA subprogram. Under normal linking, these are accumulated into the .bss section in the executable (BSS is an old IBM term meaning Block Started by Symbol). Although this section does not contribute to the size of the executable it does contribute to the size of the loaded image. The consequence of this is that the system must have the resources available to meet the size of the .bss section. This is unfortunate, since many applications use very large global arrays, only some of which is ever used.

If the SLINK command vc or virtualcommon is used at some stage during the link process, the '.bss' section is removed from the executable and the global data is allocated to virtual memory at runtime. The result is that pages of memory (4Kb each) are allocated from the system on demand.

So the loaded image may be larger when vc is not used.

Please login to reply.