<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 1/26/2017 9:00 AM, Peter Bel wrote:<br>
</div>
<blockquote
cite="mid:CAKzDyZsd-hZeY1Mo3biXT=RVKhAgjrH_ibYs_RnQP5-cJ5PzWA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>Sorry for putting this topic up, but can I ask for your
advice once again? <br>
I'm getting some very strange errors and I can't really
understand why. In my <span
style="font-family:monospace,monospace">applyFixup() </span>I
have fixup value adjustment, and for fixup <span
style="font-family:monospace,monospace">PCREL24 </span>I
have the following simple code:<br>
</div>
<div><br>
<span style="font-family:monospace,monospace">case
Epiphany::fixup_Epiphany_PCREL24<br>
Value = Value << 7;<br>
</span></div>
<div><span style="font-family:monospace,monospace"> break;</span><br>
</div>
<div><br>
</div>
<div>When I'm trying to compile a sample binary (any, even
without this fixup type), it "might fail" on <span
style="font-family:monospace,monospace">MC/ELFObjectWriter.cpp::executePostLayoutBinding():392</span>,
which is called from <span
style="font-family:monospace,monospace">MCAssembler.cpp::layout()</span>.
If fails on the following line:<br>
</div>
<div><span style="font-family:monospace,monospace">const auto
&Alias = cast<MCSymbolELF>(A);<br>
<br>
</span></div>
<div>"Might fail" - because it doesn't fail every time. I can
change some other completely unrelated piece of code - and
suddenly it'll fail. If I'll change it to smth else, e.g. <span
style="font-family:monospace,monospace">Value = Value</span>,
it won't fail, but it still "might fail" after some other
change. Sometimes it can fail on different lines, sometimes it
can even pass through on the first run and fail on the second.<br>
<br>
I've checked that it fails because <span
style="font-family:monospace,monospace">MCSymbol &A </span>has
<span style="font-family:monospace,monospace">A.Kind </span>different
from 2 (<span style="font-family:monospace,monospace">SymbolKindELF</span>),
usually it's 1 or 0 (COFF or Unknown).<br>
</div>
</div>
</blockquote>
<br>
This sounds like memory corruption of some sort... have you tried
asan and/or valgrind?<br>
<br>
-Eli<br>
<pre class="moz-signature" cols="72">--
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project</pre>
</body>
</html>