This is the mail archive of the crossgcc@cygnus.com mailing list for the crossgcc project.


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

RE: [Fwd: Need help on gld 2.9.1]



On 20-Oct-98 Scott Howard wrote:
>  This sounds to me like a problem with the ls command, not with the gnu
>  linker...
>  
>  Anyone on the list have suggestions for Larry?
>  
>  Larry Chu wrote:
>  
> > I downloaded the GNU gcc-2.8.1 and binutils-2.9.1. I sucessfully built a
> > cross compiler for sparc Sun solaris host and VxWorks target.
> >
> > I tested the new compiler and linker by compiling a group of source
> > files.  The compiler works fine. It built all the object files. The
> > object file sizes are comparable with the ones compiled by our current
> > version of gcc (version cygnus 2.2.3.1).
> >
> > However, after the object files were linked into an executable image,
> > the file size of the resulting image became enormous (46 meg) compared
> > with the one linked by our current linker (version 1.97.1) which
> > produced only a 1.5 to 1.9 meg file. An increase of 24 times the
> > original size!
> >
> > In addition, when I use 'ls -l' to display the file information, it
> > shows 46 meg of file size. But if I use 'ls -s' command, the block size
> > of the file is shown as 3290 blocks which corresponds to 1.68 meg. The
> > block size is very close to that of the old one.
> >
> > I would like to know what causes the difference in the sizes and how can
> > I use the new linker to produce the same smaller size image.
> >

Sounds like the linker has created a sparse file, perhaps there is some
content at a large (erroneous??) file offset but nothing in the middle.
You can do this using fseek().
So the extent of the file from beginning to end is 48M but only 3290 of those
blocks have been written to.

-- 
Mark Powell, Senior Software Engineer, Primagraphics Limited
New Cambridge House, Litlington, nr.Royston, Herts, SG8 0SS, UK
Tel. +44 1763 852222, Fax. 853324, medp@primag.co.uk, http://www.primag.co.uk

________________________________________________
To get help for the crossgcc list, send mail to
crossgcc-request@cygnus.com with the text 'help'
(without the quotes) in the body of the message.