<br>Hi Leonid,<br><br><div class="MsoNormal"> </div>I don’t thing it is a problem with static or global pointers. It is something to do with relocation of a section .rodata<span style=""> </span>which holds string constants like “U-Boot 1.1.3” .<br><div class="MsoNormal">I faced a similar problem, I had NOR (boot flash) and NAND flash sharing EBC pins. That is<span style=""> </span>either I can use NOR flash or NAND flash but not both at the same time.When I gave the EBC pin’s control to NAND flash, u-boot used to crash.<br>I found that it use to crashing at the line<br><span style="font-size: 12pt; font-family: "Times New Roman";">static const char *l = "xwr";<br>In this case string used to be in .rodata section.<br>And i found that pointer “l” is pointing to a location that is of the NOR flash, which means relocation from boot flash (i.e. NOR) to SDRAM didn’t happen for all the sections.</span></div><pre><span style="">I didn’t know how to fix
this issue in Linker descriptor file.<br>But I had alternate solution that is, I replaced the above <br>code with:<o:p></o:p></span><span style="font-family: "Times New Roman";"><br></span>static const char l[] = "xwr";<br><span style="font-size: 12pt; font-family: "Times New Roman";">In this case string “xwr” was in .data section.</span><br></pre><span style="font-size: 12pt; font-family: "Times New Roman";"></span><div class="MsoNormal"><span style="font-size: 12pt; font-family: "Times New Roman";"></span> Thanks,<br><b><i>-Mushtaq Khan<br></i></b></div><div class="MsoNormal"><b><i><br></i></b></div><div class="MsoNormal"><b><i>Leonid <Leonid@a-k-a.net></i></b> wrote:</div><div class="MsoNormal"><br></div><blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> Hi:<br><br>Because u-boot reallocates itself, static/global variables cannot be<br>freely used there - if
something is initialized using pointers on such<br>variables, they actually points to wrong addresses (may be on flash)<br>after reallocation.<br><br>What is simplest way to fix this problem - surely many people have<br>bumped into that?<br><br>U_BOOT_CMD macro kind of does the trick for entries of u-boot CLI, but<br>when I tried to mimic this logic buy organizing special section for my<br>variables, I have here and there, it didn't work. Probably I miss<br>something.<br><br>Does anybody have a suggestion?<br><br>Thanks,<br><br>Leonid.<br><br>-------------------------------------------------------------------------<br>Take Surveys. Earn Cash. Influence the Future of IT<br>Join SourceForge.net's Techsay panel and you'll get the chance to share your<br>opinions on IT & business topics through brief surveys-and earn cash<br>http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV<br>_______________________________________________<br>U-Boot-Users
mailing list<br>U-Boot-Users@lists.sourceforge.net<br>https://lists.sourceforge.net/lists/listinfo/u-boot-users<br></blockquote><br><p> 
<hr size=1></hr>
Check out what you're missing if you're not on <a href="http://us.rd.yahoo.com/mail/in/ymessenger/*http://in.messenger.yahoo.com/">Yahoo! Messenger</a>