COMMON Blocks that are Common Across Object Modules
Knox, William J
knoxw@battelle.org
Wed Feb 29 15:04:00 GMT 2012
GFortran Community,
We're working on a large Fortran application under VxWorks 6.6 and compiling with GFortran 4.5.1. The legacy software is arrayed as several object modules that are loaded at run-time. Many of these object modules declare the same COMMON block and expect that they will be addressing the same area. The location of certain of these common blocks is critical and has to be very specific in order to support inter-processor access of the data via PCI/VME bus mapping.
What we are experiencing is that as each object module is loaded (via loadModule), a new definition of the symbol for a common block is added to the symbol table. After loading completes for the several object modules, there are multiple definitions of the same common block symbol, each with its own address. It's clear that the COMMON block is not common across the loaded object modules. Is there some compiler/linker/loader option that can force these COMMON blocks to reference the same location in memory?
I can provide additional detail as necessary. My linker/loader/GCC experience is rusty and was a little thin to begin with. Any insights would be greatly appreciated.
Bill
More information about the Fortran
mailing list