This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Can I strip some debug section and why we need to cross-compile readelf
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: loody <miloody at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Tue, 10 Mar 2009 14:36:20 +1030
- Subject: Re: Can I strip some debug section and why we need to cross-compile readelf
- References: <3a665c760903080642u6f3e3cafl73399961cc762659@mail.gmail.com>
On Sun, Mar 08, 2009 at 09:42:29PM +0800, loody wrote:
> When I try to strip "debug_info" section in my program, I find all
> debug sections are striped.
objcopy -R .debug_info will just remove the section.
> Does that mean it is impossible to strip any debug section, since they
> have some connection?
They certainly are connected, and stripping .debug_info renders some
of the other sections useless. You can find versions of the dwarf
standard on the web, which will show you the relationship between
sections.
> BTW, why we need to cross-compile readelf?
> In my opinion, readelf is platform independent, since it is used to
> parse ELF format, which is a standard, instead of reading the content
> of each section like objdump does.
> If my assumption is wrong, please correct me.
You might want to run readelf on the target.
--
Alan Modra
Australia Development Lab, IBM