<br><br><div class="gmail_quote">On Thu, Aug 4, 2011 at 5:18 AM, Rafael Ávila de Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com">rafael.espindola@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

nit: remove trailing white space:<br>
<div class="im">> +<br>
> +    // Check that the upper bits are either all 0 or all 1's<br>
> +    switch (Size) {<br>
> +    case 1:<br>
> +      assert((isInt<8>(Value) || isUInt<8>(Value))&&<br>
> +             "Value does not fit in a 1Byte Reloc");<br>
> +      break;<br>
> +    case 2:<br>
> +      assert((isInt<16>(Value) || isUInt<16>(Value))&&<br>
> +             "Value does not fit in a 2Byte Reloc");<br>
> +      break;<br>
> +    case 4:<br>
> +      assert((isInt<32>(Value) || isUInt<32>(Value))&&<br>
> +             "Value does not fit in a 4Byte Reloc");<br>
> +      break;<br>
> +    }<br>
> +<br>
<br>
</div>Note that this is asserting on the symbol value, not the addend as the<br>
old assert was. The assert for the addend should only depend on the ELF<br>
format being 32 (isInt<32>) or 64 bits (isInt<64>), since that is the<br>
only real constraint that the file format has.<br>
<br>
For the symbol value your asserts looks correct, but you might want to<br>
account for the relocation being signed or unsigned too.<br>
<br></blockquote><div><br></div><div>Do you mean preserve the signedness of the target specific reloc tag specification? Hmm..</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">


This also found a bug on the elf dumper, since it is only printing 32<br>
bits of the addend.<br>
<br>
I will try to take a look at adding back an assert for the addend and<br></blockquote><div><br></div><div>My initial idea was to add a new virtual at ELFObjectWriter-  CheckRelocSizeBounds(ERE)  but decided against it.</div>

<div>If you really want to check the addend also, perhaps its best done there.</div><div>What do you think?</div><div><br></div><div>-jason</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">


the elf dumper problem. Can you take a look at the making the symbol<br>
value assert more strict?<br>
<br>
Cheers,<br>
<font color="#888888">Rafael<br>
</font><div><div></div><div class="h5">_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br>