This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Fw: Does ld removes uncalled functions from final exe ?
- From: "Valery Pykhtin" <pykhtin at prosoft dot ural dot ru>
- To: <binutils at sources dot redhat dot com>
- Date: Mon, 6 Sep 2004 13:23:06 +0600
- Subject: Fw: Does ld removes uncalled functions from final exe ?
Hi all,
I wrote simple test program to discover wheter ld removes unreachable code.
test.c
int main(blablabla)
{
return 0;
}
testfx.c
int fx(int a)
{
a += random(); // a lot of reps of this line
....
return a;
}
Than I tried to link these files into .exe and discovered no difference in
size when I call fx from main or not. However if I removed testfx.c from
makefile, the size of exe became smaller.
I've tried some options to linker such as -O, -x, -s but nothing helps.
Can anyone give some comments to this ?
Very thanks