<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Mon, Mar 19, 2018 at 2:57 PM Rafael Avila de Espindola <<a href="mailto:rafael.espindola@gmail.com">rafael.espindola@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">David Blaikie via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> writes:<br>
<br>
> On Mon, Mar 19, 2018 at 2:24 PM Rafael Avila de Espindola via Phabricator <<br>
> <a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>> wrote:<br>
><br>
>> espindola added inline comments.<br>
>><br>
>><br>
>> ================<br>
>> Comment at: test/ELF/undef.s:37<br>
>><br>
>> +# CHECK: warning: parsing line table prologue at 0x00000000 should have<br>
>> ended at 0x00000038 but it ended at 0x00000037<br>
>>  # CHECK: error: undefined symbol: zed6<br>
>> ----------------<br>
>> I think I agree with George about producing an error on corrupted output.<br>
>> In practice we expect to never see it, so we may as well make the code<br>
>> simpler.<br>
>><br>
><br>
> Seems like it'd be unfortunate if you had a shipped binary library with<br>
> some bogus DWARF (or, say, we had a bug in the DWARF parser that caused a<br>
> parse failure?) & you had linker errors you couldn't diagnose because the<br>
> linker just told you about the bogus DWARF but not about the missing symbol<br>
> you could act on (by, say, linking in some other library you forgot to pass<br>
> to the linker?)? (if I'm understanding correctly here that you're<br>
> suggesting erroring on the bogus DWARF and stopping there/not providing the<br>
> undefined symbol error?)<br>
<br>
No, you would still get an error like<br>
<br>
./build/bin/ld.lld: error: undefined symbol: foo<br>
>>> referenced by test.o:(.data+0x0)<br>
.... something about not being able to parse the debug info....<br></blockquote><div><br>Ah, cool!<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Now that I think of it, the fact that lld could not parse the debug info<br>
to provide a better error message should always be a note, not an<br>
error, regardless of how broken the section happens to be.<br></blockquote><div><br></div><div>Yeah, sounds fair to me. (for building gdb-index, say, that'd probably be an error - but yeah, just parsing it to improve diagnostic quality doesn't seem like it warrants an error on parse failure)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Cheers,<br>
Rafael<br>
</blockquote></div></div>