GNUARM Linker Question

Started by James Dabbs May 3, 2004
GNUARM Linker Question

Can GNUARM's linker (ld) be coaxed to remove functions that are never referenced?

Thanks,

James Dabbs, TGA


An Engineer's Guide to the LPC2100 Series

Hi James,

> Can GNUARM's linker (ld) be coaxed to remove functions that are never
referenced?

The typical way this is done is to have the functions in a separate
object file. The GNU linker either pulls in an entire object file or
doesn't pull it in at all (typically from a library). Many runtime
libraries are strutured to compile the code such that one object file is
produced per function. They often put the functions in a single source
file, and use preprocessor directives to control which parts get
compiled. --
Dave Hylands
Vancouver, BC, Canada
http://www.DaveHylands.com/