This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Debuggin info for unused sections


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]