[PATCH] D31464: [ELF] - Stop producing broken entries in .debug_ranges section

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 4 08:25:22 PDT 2017


I'd like to reiterate what I said before on this:

"If anything like this is going to be done - I suspect the right place to
discuss it is on the DWARF committee (or at the very least, crossposted
between llvm-dev and lldb-dev with all the Usual Suspects of debug info
support included (echristo, aprantl, Paul Robinson, myself))"

I think any part of DWARF that /needs/ special casing in the linker (short
of explicit constructs like the index building) is a bit suspect given the
strong goals of the DWARF committee to be pretty object-file neutral and
warrants some discussion to figure out if it's necessary/appropriate/etc.

(but I'm not a code owner of the LLD project - so they (Rui, Rafael) can
that suggestion/advice as they prefer, of course)

On Tue, Apr 4, 2017 at 3:30 AM George Rimar via Phabricator <
reviews at reviews.llvm.org> wrote:

> grimar added inline comments.
>
>
> ================
> Comment at: ELF/InputSection.cpp:533-538
> +    // If address range list contains entry that belongs to discarded
> +    // section, we should perform a fix up. We can not write zero as
> start and
> +    // end address because that would mean unexpected end of range. So we
> put a
> +    // placeholder value equal to 1, that is correct to do because a
> range list
> +    // entry whose begining and end adress are equal has no effect,
> because size
> +    // of range is zero in such case.
> ----------------
> jhenderson wrote:
> > grimar wrote:
> > > jhenderson wrote:
> > > > A few grammar nits and minor improvements to this comment. I suggest
> the following:
> > > >
> > > > "If an address range list contains an entry that belongs to a
> discarded section, we should perform a fix-up. We cannot write zero as the
> start and end address because such a pair is an end of range list marker in
> the .debug_ranges section. We put a placeholder value equal to 1, which is
> fine because a range list entry whose beginning and end address are equal
> has no effect, because the size of the range is zero in such case."
> > > Fixed. thanks !
> > Sorry, one more grammar nit I missed - the last bit should say "in such
> a case."
> Thanks !
>
>
> ================
> Comment at: ELF/InputSection.cpp:545
>
> +static bool isInDiscardedSection(SymbolBody &Body) {
> +  DefinedRegular *D = dyn_cast<DefinedRegular>(&Body);
> ----------------
> jhenderson wrote:
> > I think this can be a const reference.
> We usually do not use const references in LLD.
> Its a bit complicated. I think no const is consistent with code and ok
> here.
>
>
> https://reviews.llvm.org/D31464
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170404/e49014bb/attachment.html>


More information about the llvm-commits mailing list