This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Debuggin info for unused sections
- From: nick clifton <nickc at redhat dot com>
- To: "Kaushik, Praveen_Kumar" <Praveen_Kumar dot Kaushi at atmel dot com>
- Cc: binutils at sourceware dot org, "Kaushik, Praveen_Kumar" <Praveen_Kumar dot Kaushik at atmel dot com>
- Date: Wed, 04 Jan 2012 11:19:40 +0000
- Subject: Re: Debuggin info for unused sections
- References: <DB7B9DAED0B660469F69536325A1D65A042E0781@penmb01.corp.atmel.com>
Hi Praveen,
While using -gc-sections to remove unused sections, the section is removed but the debug info in not removed.
Is this expected?
Yes.
> Can we completely remove the debug info for unused section?
It *could* be done, but it would take some effort.
The assembler would have to generate .debug_line.<foo> sections
containing the line number debug information for each .main.<foo>
section, and ensure that there is a relocation referencing .main.<foo>
inside .debug_line.<foo>. Then the linker would have to be taught that
it can garbage collect *some* debug sections (ie .debug_line).
So yes, it is possible. You just need to persuade someone to do it. Or
do it yourself, of course.
Cheers
Nick