This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: dead function elimination
- From: jimmy <jimmyb at huawei dot com>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: binutils at sourceware dot org, gcc-help at gcc dot gnu dot org
- Date: Thu, 09 Nov 2006 14:40:42 +0530
- Subject: Re: dead function elimination
- References: <4552DE07.5050702@huawei.com> <4552EB64.20000@redhat.com>
Nick Clifton wrote:
Hi Jimmy,
Can gcc or ld perform dead procedure elimination apart from using the
combination of --gc-sections/-ffunction-sections?
(Why are you excluding the --gc-sections / -ffunction-sections pairing
which were designed precisely for this purpose ?)
The short answer is yes. Gcc can and will eliminate unused local
procedures, and with its --whole-program option it can even eliminate
unused non-local procedures.
But your question implies that you are asking if between them the linker
and compiler can eliminate unused procedures without recompilation of
all the sources, and in this case the answer is no.
Cheers
Nick
I thght the linker alone was supposed to be able to do
dead-procedure-elimination. After all can't the linker determine which
procedures are unreferenced in the final executable?
If i'm not mistaken the diablo linker can do this?
Thanks!
-jb
--
mathematician, n.:
Some one who believes imaginary things appear right before your
i's.