<div dir="ltr">I'd like to reiterate what I said before on this:<br><br>"<span style="color:rgb(33,33,33)">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))"<br><br>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.<br><br>(but I'm not a code owner of the LLD project - so they (Rui, Rafael) can that suggestion/advice as they prefer, of course)</span></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Apr 4, 2017 at 3:30 AM George Rimar via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">grimar added inline comments.<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
================<br class="gmail_msg">
Comment at: ELF/InputSection.cpp:533-538<br class="gmail_msg">
+ // If address range list contains entry that belongs to discarded<br class="gmail_msg">
+ // section, we should perform a fix up. We can not write zero as start and<br class="gmail_msg">
+ // end address because that would mean unexpected end of range. So we put a<br class="gmail_msg">
+ // placeholder value equal to 1, that is correct to do because a range list<br class="gmail_msg">
+ // entry whose begining and end adress are equal has no effect, because size<br class="gmail_msg">
+ // of range is zero in such case.<br class="gmail_msg">
----------------<br class="gmail_msg">
jhenderson wrote:<br class="gmail_msg">
> grimar wrote:<br class="gmail_msg">
> > jhenderson wrote:<br class="gmail_msg">
> > > A few grammar nits and minor improvements to this comment. I suggest the following:<br class="gmail_msg">
> > ><br class="gmail_msg">
> > > "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."<br class="gmail_msg">
> > Fixed. thanks !<br class="gmail_msg">
> Sorry, one more grammar nit I missed - the last bit should say "in such a case."<br class="gmail_msg">
Thanks !<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
================<br class="gmail_msg">
Comment at: ELF/InputSection.cpp:545<br class="gmail_msg">
<br class="gmail_msg">
+static bool isInDiscardedSection(SymbolBody &Body) {<br class="gmail_msg">
+ DefinedRegular *D = dyn_cast<DefinedRegular>(&Body);<br class="gmail_msg">
----------------<br class="gmail_msg">
jhenderson wrote:<br class="gmail_msg">
> I think this can be a const reference.<br class="gmail_msg">
We usually do not use const references in LLD.<br class="gmail_msg">
Its a bit complicated. I think no const is consistent with code and ok here.<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
<a href="https://reviews.llvm.org/D31464" rel="noreferrer" class="gmail_msg" target="_blank">https://reviews.llvm.org/D31464</a><br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
</blockquote></div>