"Ton van Overbeek" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> In article <[EMAIL PROTECTED]>, Gregg Woodcock wrote:
> >
> > Armed with the map file I can see that indeed, it is now (and actually
> > probably was in the beginning) creating a large(r) coderes segment as
> > evidenced by these 2 differences:
> > coderes 0x00000000 0x00008002
> > coderes 0x00000000 0x0000fcd0
> >
> > The reason I assumed it *wasn't* working was because I get the classic
> > "coderes is full" error when linking in the FourKLib library.  The
library
> > itself is actually 23080 bytes but the author told me that this gets
trimmed
> > by the linker (for my type of use) to about 4K (I am only using 3
functions
> > out of the 40 or so).
> >
> > So the REAL problem I am having is that the compiler is including ALL
the
> > library instead of just the pieces I am actually referencing/using.
Perhaps
> > I have settings of the linker so that it is not properly discarding
unused
> > library code?  Evidently what the linker does is allocate space for ALL
the
> > functions in an included library FIRST and then strips out the actual
code
> > after the fact.  Therefore I need to be able to fit the entire 23+K into
the
> > codres even though only 4K or so will end up there.
> >
> > Is there way to force the compiler to evaluate which functions are
> > actually used BEFORE it stakes out space for them in the codres so that
it
> > will not consider unused ones?
>
> If it is a proper library, then that is exactly what the linker will do.
> It seems that for some reason the whole library is pulled in. If you link
> with -Wl,--verbose you can see which modules are extracted from
lib<name>.a.
> Also the link map contains this information.

Yes, the map file indicates they are ALL in there; I *know* that's the
probem...

> Then you will have to figure out why it pulls in everything.

Yes, that's the issue!

> Some things which might help: Look at the symbol definitions with nm:
> 'm68k-palmos-nm -s <your lib>'
> If there is no library index, create one with 'm68k-palmos-ranlib <your
lib>'.

I actually have direct access to the 3rd-party library developer and would
like to dump this in his lap.  You said, "if it is a proper library" the
linker will optomize out unused code BEFORE it gets staked out in the
coderes.  What detemines "if it is a proper library"?  Is there something I
can tell him to do/check/try such that he can produce a "proper library" for
me to use?  What will I be seeking in the nm?  What will it show me?





-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to