Mail Archives: djgpp/1998/11/08/04:58:21
On Thu, 5 Nov 1998, Mapson wrote:
> A majority of opinions seem to think
> that all the object code of libs gets dropped in in a link.
This is most definitely incorrect, not only with DJGPP, but with any
other linker I have ever seen.
> In the
> past I have wondered if it works by specific object modules in the
> archive. That is, if I have 7 different ".o" files comprising a lib, a
> call requiring code from one ".o" file simply takes that entire ".o"
> file's worth of code.
This is correct: most linkers link in entire object modules, they
cannot extract parts of object modules. You need to make your object
modules as small and independent as possible. If at all possible,
make every function be a separate module.
> >Did you strip the executables? If not, the overhead of the debug info
> >in the executable completely overshadows the actual amount of code.
>
> The reason I don't strip these particular executables is because my
> understanding of stripping is that it removes debugging information.
No, it removes much more than that. Try that, and I'm almost positive
you will see both executables get the same size.
- Raw text -