[lld] r298815 - Do not use assert to report broken input files.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 29 12:48:46 PDT 2017


Reverted in r298815.

On Tue, Mar 28, 2017 at 2:11 PM, Rui Ueyama <ruiu at google.com> wrote:

> That is probably right -- .eh_frame is split into section pieces that are
> contiguous. Thank you for noticing. I'll revert this change.
>
> On Tue, Mar 28, 2017 at 1:36 PM, Rafael EspĂ­ndola <
> rafael.espindola at gmail.com> wrote:
>
>> My memory is a bit fuzzy, but I think this should be an assert.
>>
>> The only way we can get here is if there is a gap in the pieces, and I
>> think the only way we can have on is if there is a bug in the
>> .eh_frame parsing logic.
>>
>> Cheers,
>> Rafael
>>
>>
>>
>> On 26 March 2017 at 14:23, Rui Ueyama via llvm-commits
>> <llvm-commits at lists.llvm.org> wrote:
>> > Author: ruiu
>> > Date: Sun Mar 26 13:23:22 2017
>> > New Revision: 298815
>> >
>> > URL: http://llvm.org/viewvc/llvm-project?rev=298815&view=rev
>> > Log:
>> > Do not use assert to report broken input files.
>> >
>> > Modified:
>> >     lld/trunk/ELF/Relocations.cpp
>> >
>> > Modified: lld/trunk/ELF/Relocations.cpp
>> > URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Relocation
>> s.cpp?rev=298815&r1=298814&r2=298815&view=diff
>> > ============================================================
>> ==================
>> > --- lld/trunk/ELF/Relocations.cpp (original)
>> > +++ lld/trunk/ELF/Relocations.cpp Sun Mar 26 13:23:22 2017
>> > @@ -683,7 +683,11 @@ public:
>> >        ++I;
>> >      if (I == Size)
>> >        return Off;
>> > -    assert(P[I].InputOff <= Off && "Relocation not in any piece");
>> > +
>> > +    if (Off < P[I].InputOff) {
>> > +      error("relocation not in any piece");
>> > +      return -1;
>> > +    }
>> >
>> >      // Offset -1 means that the piece is dead (i.e. garbage collected).
>> >      if (P[I].OutputOff == -1)
>> >
>> >
>> > _______________________________________________
>> > llvm-commits mailing list
>> > llvm-commits at lists.llvm.org
>> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170329/11cd150e/attachment.html>


More information about the llvm-commits mailing list