<div dir="ltr"><div>If you apply this patch, your new tests will fail because relocations are out of range. I think the tests are creating too large values. Can you fix that?</div><div><br></div><div>diff --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp</div><div>index 086b3ad5594..772e22f41a6 100644</div><div>--- a/lld/ELF/Target.cpp</div><div>+++ b/lld/ELF/Target.cpp</div><div>@@ -511,17 +511,24 @@ uint64_t X86TargetInfo::getImplicitAddend(const uint8_t *Buf,</div><div> </div><div> void X86TargetInfo::relocateOne(uint8_t *Loc, uint32_t Type,</div><div>                                 uint64_t Val) const {</div><div>-  checkInt<32>(Loc, Val, Type);</div><div>-</div><div>   // R_386_{PC,}{8,16} are not part of the i386 psABI, but they are</div><div>   // being used for some 16-bit programs such as boot loaders, so</div><div>   // we want to support them.</div><div>-  if (Type == R_386_8 || Type == R_386_PC8)</div><div>+  switch (Type) {</div><div>+  case R_386_8:</div><div>+  case R_386_PC8:</div><div>+    checkInt<8>(Loc, Val, Type);</div><div>     *Loc = Val;</div><div>-  else if (Type == R_386_16 || Type == R_386_PC16)</div><div>+    break;</div><div>+  case R_386_16:</div><div>+  case R_386_PC16:</div><div>+    checkInt<16>(Loc, Val, Type);</div><div>     write16le(Loc, Val);</div><div>-  else</div><div>+    break;</div><div>+  default:</div><div>+    checkInt<32>(Loc, Val, Type);</div><div>     write32le(Loc, Val);</div><div>+  }</div><div> }</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 27, 2017 at 1:19 AM, George Rimar <span dir="ltr"><<a href="mailto:grimar@accesssoftek.com" target="_blank">grimar@accesssoftek.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div dir="ltr" style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif"><div><div class="h5">
<p><span style="font-size:12pt;color:rgb(33,33,33)">>>But we already have the same assignment in </span><span style="font-size:12pt;color:rgb(33,33,33)">X86_64TargetInfo<ELFT>::<wbr>relocateOne</span><span style="font-size:12pt;color:rgb(33,33,33)">,
 so I guess we've accepted that?</span><br>
</p>
</div></div><div dir="ltr" style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
<div>
<div style="color:rgb(33,33,33)">
<div><div><div class="h5">
<div class="gmail_extra">><br>
<div class="gmail_quote">>I guess that means we are not compiling LLD with this and probably other useful warnings.<br>
</div>
<span style="font-size:12pt">>Type conversion warnings can be useful for static analysis and I would fix that place too instead of accepting.</span></div>
<div class="gmail_extra"><span style="font-size:12pt">> </span></div>
<div class="gmail_extra"><span style="font-size:12pt">>George.</span></div>
<div class="gmail_extra"><span style="font-size:12pt"><br>
</span></div>
</div></div><div class="gmail_extra">
<p style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">By the way, found we have next code in linkerscript.cpp<br>
</p>
<p style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px"><br>
</p>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">
template <class ELFT></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">
static void writeInt(uint8_t *Buf, uint64_t Data, uint64_t Size) {</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">
  const endianness E = ELFT::TargetEndianness;</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">
  switch (Size) {</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">
  case 1:</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">
    *Buf = (uint8_t)Data;​<span class="HOEnZb"><font color="#888888"><br>
</font></span></div><span class="HOEnZb"><font color="#888888">
<div><br>
​George.<br>
</div>
<span style="font-size:12pt"><br>
</span></font></span></div>
</div>
</div>
</div>
</div>
</div>

</blockquote></div><br></div>