<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2017-06-20 1:23 GMT+03:00 Hesham Almatary <span dir="ltr"><<a href="mailto:heshamelmatary@gmail.com" target="_blank">heshamelmatary@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Tue, Jun 20, 2017 at 7:33 AM, Denis Obrezkov <span dir="ltr"><<a href="mailto:denisobrezkov@gmail.com" target="_blank">denisobrezkov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="m_3115160688977774507gmail-">2017-06-20 0:19 GMT+03:00 Joel Sherrill <span dir="ltr"><<a href="mailto:joel@rtems.org" target="_blank">joel@rtems.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">Check the value in gdb without loading it on a target.<div dir="auto"><br></div><div dir="auto">Gdb hello.exe</div><div dir="auto"><br></div><div dir="auto">p symbol </div></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div dir="auto"><br></div><div dir="auto">Since it is a constant, it should be as expected. If it is, you have a code loading issue.</div></div></blockquote></span><div>Yes, it is 512 in gdb, as expected. So, is the problem with linkcmd file? </div><span class="m_3115160688977774507gmail-"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div dir="auto"><br></div><div dir="auto">Is that value by any chance an instruction? </div></div></blockquote></span></div></div></div></blockquote></span><div>No don't think so.<br> <br></div><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>How to check whether it is an instruction or not?</div><div><br></div></div></div></div></blockquote></span><div>You can check if this value might match with any riscv32 instruction encodings (I believe it doesn't). See Chapter 19 (RV32/64G Instruction Set Listings) user-level riscv-spec 2.3-draft. You can also use riscv32-rtems4.12-objdump on your binary and search for this value.<br><br></div><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div></div><div>I was also able to run gdb, connect to the target, change the value of the variable to 512,</div><div>reconnect to the target, make loading and read the value equal to 512.</div></div><span class="m_3115160688977774507gmail-HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div class="m_3115160688977774507gmail-m_6857958987714243169gmail_signature">Regards, Denis Obrezkov</div>
</font></span></div></div>
</blockquote></span></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><br>-- <br><div class="m_3115160688977774507gmail_signature">Hesham</div>
</font></span></div></div>
</blockquote></div><div class="gmail_extra"><br></div>I didn't find this value in objdump<br>I think that .data section wasn't properly initialized, does it look reasonable? <br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Regards, Denis Obrezkov</div>
</div></div>