On Sat, Sep 4, 2010 at 5:35 PM, pancake <panc...@youterm.com> wrote: > Function per file is because the stupid gnu linker does not statically > compile functions. Only objects. Afaik. This way the resulting bin can be > smaller. >
gcc has -ffunction-sections and ld has -gc-sections. >From the gcc manual: -ffunction-sections -fdata-sections Place each function or data item into its own section in the output file if the target supports arbitrary sections. The name of the function or the name of the data item determines the section's name in the output file. >From the ld manual: --gc-sections --no-gc-sections Enable garbage collection of unused input sections. It is ignored on targets that do not support this option. The default behaviour (of not performing this garbage collection) can be restored by specifying `--no-gc-sections' on the command line. Maybe this is what you seek ? -- Kind regards, HP