This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: [PATCH 2/5] Make IDX_debug_types come last. In a subsequent patch we will put all .debug_types sections@the end the of the section array. This change arranges for them to appear sequentially.
- From: Roland McGrath <roland at hack dot frob dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Tue, 20 Mar 2012 14:20:17 -0700
- Subject: Re: [PATCH 2/5] Make IDX_debug_types come last. In a subsequent patch we will put all .debug_types sections@the end the of the section array. This change arranges for them to appear sequentially.
I see no reason to think that the multiple-sections issue in an ET_REL file
would be limited to .debug_types. A producer doing proper CUs for COMDAT
cases would have multiple .debug_info sections by the same token. For
these two flavors, it can make sense just to iterate over all the sections.
(The same is true of aranges, line, frame--all the "independent" or "root"
sections that are examined on their own rather than pointed to by DIEs.)
But such a producer could very well produce multiple .debug_{abbrev,str} et
al sections, each in the COMDAT group with the .debug_info or .debug_types
that points at it. And for those, the only way to figure out the right
section to be looking at is by following the relocation records for the
.debug_{info,types} section data. We could in theory handle this after we
merge the roland/relocate branch, but the reorganization of struct libdwP
would have to be more substantial than what you've done here.
All in all, this looks to me like a half-measure to handle just one
particular case you've encountered. That case is part of a large class of
general ET_REL cases that we decided long ago libdw had no reason to try to
handle. Either we should handle the full generality of ET_REL files
thoroughly--a lot of work that I'm quite doubtful is worthwhile--or we
should stick to the existing decision that we handle ET_REL files only for
the very special case of Linux .ko files (in which the DWARF info looks
much more like the output of a final link for most purposes).
Thanks,
Roland