From: Hans-Bernhard Broeker Newsgroups: comp.os.msdos.djgpp Subject: Re: Has ar a limit? II Date: 8 Jun 2001 14:46:13 GMT Organization: Aachen University of Technology (RWTH) Lines: 30 Message-ID: <9fqofl$6cv$1@nets3.rz.RWTH-Aachen.DE> References: <200106081202 DOT IAA27634 AT pop3 DOT lc-2 DOT la DOT inter DOT net> <200106081327 DOT JAA24053 AT pop1 DOT lc-2 DOT la DOT inter DOT net> NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de X-Trace: nets3.rz.RWTH-Aachen.DE 992011573 6559 137.226.32.75 (8 Jun 2001 14:46:13 GMT) X-Complaints-To: abuse AT rwth-aachen DOT de NNTP-Posting-Date: 8 Jun 2001 14:46:13 GMT Originator: broeker@ To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Orlando P. Hevia wrote: >> The difference between libraries and object files is that >> object files are always linked into the program, while if >> they are in a library, they are only linked if the linker >> ``knows'' some code uses the external symbols in that object >> file. > Surely. But I think that a FORTRAN BLOCK DATA is not known > to the linker if it is in a library. The block data itself is known (as you can see it in the 'nm' output). What is not known to the linker is that the routine using those data needs this particular module to be linked in, in the first place. Have a look at an 'nm' dump of one of the modules using strings from this block: you'll notice that there is no 'u' or 'U' (for 'undefined') reference to any of the symbols defined by the block data module. This is because of the way common blocks work --- no defining instance of the common block is ever to be present, as far as the linker is concerned. I think you'll have to follow the actions described in the "Block Data and Libraries" node of the G77 manual, manually imitating part of what g77 would do automatically: put a dummy subroutine into the same module as the block data and explicitly reference that subroutine from at least one, or preferrably all modules using any of those data. -- Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) Even if all the snow were burnt, ashes would remain.