This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Help with strip
- From: Zack Weinberg <zack at codesourcery dot com>
- To: gkajmowi at tbaytel dot net
- Cc: binutils at sources dot redhat dot com
- Date: Sat, 18 Dec 2004 10:38:00 -0800
- Subject: Re: Help with strip
- References: <200412181210.28709.gkajmowi@tbaytel.net>
Garrett Kajmowicz <gkajmowi@tbaytel.net> writes:
> strip -N functionname function.o
...
> However, when I run objdump -D function.o, the only visible difference is that
> the name of the function has been stripped.
>
> I do not just want to remove the name of a function - I want to remove a
> function altogether, including its code.
Try compiling with -ffunction-sections and then using
objcopy --discard-sections.
It is in general impossible to splice a single function out of the
middle of a section.
zw