View Single Post

   
  #2 (permalink)  
Old 01-05-2008, 06:03 AM
Gary R. Hook
 
Posts: n/a
Default Re: library file size

wbsurfver@yahoo.com wrote:
> I used nm on both libraries and diffed the output of both nm commands
> and got alot of differences but I observed that it appeared to do with
> ordering and if I first sorted these
> there was no differences at all. My impression was then that
> somehow the object files linked in in a different order and some
> complexity beyond my understanding with the library file
> caused the size difference which appeared to be a substantial
> difference. I think I found a web page on the internal format which is
> XCOFF ? It looks fairly complex.
>

If an archive contains a file, and your replace (ar r) that file with an
updated version, and the new version doesn't fit in the same space as
the old, the new version will be appended to the end of the archive. A
hole is left where the old version was (ie. it's deleted, but the
archive isn't "squished". There's an ar option you can use to rebuild
the archive, which would remove all the holes.

The short answer is, if you want to ensure comparable results, always
build the archive from scratch. Never update it. (Presuming this
is the actual issue, which is not guaranteed, but just a suggestion.)

--
Gary R. Hook
__________________________________________________ ______________________
Vocatus atque non vocatus deus aderit
Reply With Quote