This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: dead function elimination
- From: Nick Clifton <nickc at redhat dot com>
- To: jimmy <jimmyb at huawei dot com>
- Cc: binutils at sourceware dot org, gcc-help at gcc dot gnu dot org
- Date: Tue, 19 Dec 2006 14:09:26 +1300
- Subject: Re: dead function elimination
- References: <4552DE07.5050702@huawei.com> <4552EB64.20000@redhat.com> <4552F092.7020405@huawei.com> <4559B37E.5070405@redhat.com> <4586503E.3010108@huawei.com>
Hi Jimmy,
If i understand things correctly, there is a restriction on
'--gc-sections' that it doesn't work if the link is dynamic. What if my
scenario is like this:
libsomething.a - some static library built with -ffunction-sections
& -fdata-sections
src.o - my source code also built with -ffucntion-sections
final step:
ld -o exec --gc-sections src.o -lsomething
In the above step, ld simply says
'/usr/bin/ld: Warning: gc-sections option ignored'
Hmm, interesting. I had thought that this would work. I will have to
look into it when I get from vacation. Are you using the most up to
date version of the linker sources ?
Cheers
Nick