This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Has ar a limit?


"Orlando P. Hevia" <heviaop@ssdfe.com.ar> writes:

> I am using ar to generate a library with a big .o file
> (640kB).
> 
> The object is generated by gcc, and it works properly when
> it is linked to the binary.
> 
> The .c file is obtained with f2cx from a FORTRAN file,
> because g77 cannot compile too big COMMONs. The FORTRAN 
> file is a block data (no sentences in it).
> 
> ar produces a library with the object, but the binary 
> obtained linking with the library runs erratically, or
> aborts.
> 
> I found the same problem with djgpp (2.03), Mingw32 (2.02),
> and Linux. 
> 
> I solved the problem linking with the .o file, but I am
> interested in include it in a library.

Perhaps the problem has to do with how common symbols are handled in
an archive.  Are you certain that the object file is being pulled in
from the archive at all?  If the symbols are common in the main
program and common in the .o file, the .o file will probably not be
pulled in; objects are only brought in from archives to satisfy
undefined symbol references, not because they happen to define the
same common symbols.  You should be able to use the linker -t or -Map
option to find out.  It might also be interesting to observe the
output from the -warn-common option in both cases.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]