delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/06/08/16:29:41

Message-Id: <200106082128.RAA25818@pop2.lc-2.la.inter.net>
From: "Orlando P. Hevia" <heviaop AT ssdfe DOT com DOT ar>
To: djgpp AT delorie DOT com
Date: Fri, 8 Jun 2001 17:26:14 -0300
MIME-Version: 1.0
Subject: Re: Has ar a limit? II
CC: tim DOT vanholder AT falconsoft DOT be, eliz AT is DOT elta DOT co DOT il,
broeker AT physik DOT rwth-aachen DOT de
In-reply-to: <9fqofl$6cv$1@nets3.rz.RWTH-Aachen.DE>
X-mailer: Pegasus Mail for Windows (v3.12b)
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

L. Broeker 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

This is that I done converting the block data to dummy 
subroutine, as first solution.

Now, I added a dummy subroutine in the same FORTRAN file, 
and converted all to C with f2c. This solution is more 
elegant, and may be the definitive one.

The limit is not in ar, it is in my knowledge.

Thanks you.

OPH. 2001-6-8 17:27


Ing. Orlando P. Hevia   
heviaop AT ssdfe DOT com DOT ar
Santa Fe-Argentina

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019