Message-Id: <200106081327.JAA24053@pop1.lc-2.la.inter.net> From: "Orlando P. Hevia" To: Eli Zaretskii Date: Fri, 8 Jun 2001 09:24:24 -0300 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: Has ar a limit? II CC: djgpp AT delorie DOT com, tim DOT vanholder AT falconsoft DOT be In-reply-to: <8296-Fri08Jun2001143742+0300-eliz@is.elta.co.il> References: <200106081202 DOT IAA27634 AT pop3 DOT lc-2 DOT la DOT inter DOT net> (heviaop AT ssdfe DOT com DOT ar) 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 Precedence: bulk Eli Zaretskii wrote: > > Can you show the converted (C) source, or a fragment of it? > I send a small fragment of original FORTRAN an a fragment of resulting C block data over51 IMPLICIT REAL*8 (A-H, O-Z), INTEGER*4 (I-N) character*80 dmup(7653) common/killcode_mup/dmup data dmup(0001)(1:40)/' 2261 110 7404 7654 (4I8)'/ data dmup(0001)(41:80)/' NEXTOV, MODULE, KNT, KCARD1.'/ data dmup(0002)/'{A80}'/ data dmup(0003)/'{A131}'/ data dmup(0004)/'{/1}'/ data dmup(0005)(1:40)/'HELP STOP DISK SPY KEY'/ data dmup(0005)(41:80)/'GO DIR BOTH { Use 1:64'/ data dmup(0006)(1:40)/'EMTP begins. Send one of following alte'/ ---- a lot of lines deleted data dmup(7652)(1:40)/' 1556 CCMINV 1557 SUBR28 162'/ data dmup(7652)(41:80)/'2 SERIES 1635 LODEPS 1637 SUBR29'/ data dmup(7653)(1:40)/' 1646 SUB29A 1685 SUB29B 169'/ data dmup(7653)(41:80)/'0 SUB29C 2208 SUB29D 2260 BOUND'/ end /* over51.f -- translated by f2c (version 19950201). You must link the resulting object file with the libraries: -lf2c -lm (in that order) */ #include "f2c.h" /* Common Block Declarations */ struct killcode_mup__1_ { char dmup[612240]; }; #define killcode_mup__1 (*(struct killcode_mup__1_ *) &killcode_mup__) /* Initialized data */ struct { char e_1[612240]; } killcode_mup__ = { {' ', ' ', ' ', ' ', '2', '2', '6', '1', ' ', ' ', ' ', ' ', ' ', '1', '1', '0', ' ', ' ', ' ', ' ', '7', '4', '0', '4', ' ', ' ', ' ', ' ', '7', '6', '5', '4', ' ', ' ', ' ', '(', '4', 'I', '8', ')', ' ', 'N', 'E', 'X', 'T', 'O', 'V', ',', ' ', 'M', 'O', 'D', 'U', 'L', 'E', ',', ' ', 'K', 'N', 'T', ',', ' ', 'K', 'C', 'A', 'R', 'D', '1', '.', ' ', ' ', ' ', ' ', ' ', ' ', ------- a lot of lines deleted '4', '6', ' ', 'S', 'U', 'B', '2', '9', 'A', ' ', ' ', ' ', ' ', ' ', '1', '6', '8', '5', ' ', 'S', 'U', 'B', '2', '9', 'B', ' ', ' ', ' ', ' ', ' ', '1', '6', '9', '0', ' ', 'S', 'U', 'B', '2', '9', 'C', ' ', ' ', ' ', ' ', ' ', '2', '2', '0', '8', ' ', 'S', 'U', 'B', '2', '9', 'D', ' ', ' ', ' ', ' ', ' ', '2', '2', '6', '0', ' ', 'B', 'O', 'U', 'N', 'D', ' '} }; The original FORTRAN has 920kB, the complete C has 3.5MB, the object has 640kB. The routine assign text to messages of a big program. Until nowm the text was assigned by reading a direct access file due to f77 problem to compile too big common blocks. The gcc compiles the equivalent C without problem. > 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. I am not expert in this subject of linker/external symbols/libraries. > > So the question is: does the converted code have external > symbols (except its own name) that other code references. > That's why I asked to see the converted code. > May be that my previous message and this one help you. When I converted the BLOCK DATA to a subroutine with only the data lines (change block data by subroutine, and call the subroutine at beginning of main), the linker founds it in library and all is OK. Regards, OPH. 2001-6-8 9:36 Ing. Orlando P. Hevia heviaop AT ssdfe DOT com DOT ar Santa Fe-Argentina