[Skiboot] [PATCH 2/2] Dead code and data elimination

Stewart Smith stewart at linux.vnet.ibm.com
Mon Feb 6 19:04:58 AEDT 2017

Nicholas Piggin <npiggin at gmail.com> writes:

> Add an experimental option to do basic dead code and data elimintation
> with -ffunction-sections/-fdata-sections/--gc-sections.
> This saves about 80kB of text/data.
> Also remove the use of of -ffunction-sections by default. This predates
> git history, but I don't think there is a good reason to use it without
> --gc-sections. The GCC manual says:
>     Only use these options when there are significant benefits from
>     doing so. When you specify these options, the assembler and linker
>     create larger object and executable files and are also slower. You
>     cannot use gprof on all systems if you specify this option, and you
>     may have problems with debugging if you specify both this option
>     and -g.
> Signed-off-by: Nicholas Piggin <npiggin at gmail.com>

Interesting... This seems to save 14kb of xz compressed space, which
also isn't too bad.

Looking through the output of --print-gc-sections, it's a little bit
interesting, and could be a good starting point for someone who wants to
go and find dead code to remove.

So, merged to master as of 2bec353d38a685a4352f48fbbf0d765359da3bdb

Stewart Smith
OPAL Architect, IBM.

More information about the Skiboot mailing list