On Wed, Jun 2, 2010 at 9:46 AM,  <bruce.lab...@autoliv.com> wrote:
> Is there a way to repackage a static library (to reduce it size) by
> including only the functions (and their dependencies) that are needed?

  Trying adding --gc-sections to the command line compile.  This will
garbage collect unused stuff, so it's not included.  I'm unsure how
well this will work with something compiled without
-ffunction-sections tho.

> Are there any tools to help do this?  (Help find dependencies, especially.
>  I think doing this manually would take months...)

  The archives will normally do this themselves, however, it will only
limit it to only including the object files in the library, not always
the *functions* only.  What you want is called 'function level
linking'.  It occured to me that, I'm not sure how it can work with
newer versions of gcc, however, a good pointer on using rlink:

https://ribosome.helixcommunity.org/2005/devdocs/FuncLevelLinking

-- 
-- Thomas

_______________________________________________
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/

Reply via email to