<html><head><style type="text/css">body{font:12px Arial;margin:3px;overflow-y:auto;overflow-x:auto}p{margin:0px;}blockquote, ol, ul{margin-top:0px;margin-bottom:0px;}</style></head>
<body><div style="DISPLAY: block; FONT-SIZE: 12px; FONT-FAMILY: Arial"><DIV dir=ltr>
<DIV id=idOWAReplyText6579 dir=ltr>
<DIV dir=ltr>Hi,</DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr>We have a custom board based on Lite5200B and started our development from Freescales BSP including U-Boot 1.1.5. </DIV>
<DIV dir=ltr>I have now added a U-Boot command that includes code from an earlier project. In that code there is a static vector declared at file scope with function pointers in it. When I recieve data via CAN I look up which function to start and uses the function pointer in the vector. Since the function pointers are set at compile time they point to flash memory and execution jumps to flash.</DIV>
<DIV dir=ltr>Is that as expected or? In binaries for ARM the linker has made all the reallocation. In my binary all adresses are in flash. I thought this would magically change after reallocation and my function pointer should point to the new ram adress. Do I need to do something special to get my function pointers to point to ram?</DIV>
<DIV dir=ltr>Or do I have to initialize the vector with function pointers in runtime to get the correct adress?</DIV>
<DIV dir=ltr>I guess the GOT has something to do with this but I'm not very good at assembler so I'm not sure what happens.</DIV>
<DIV dir=ltr>Is there a "best practice" for function pointers and U-Boot?</DIV>
<DIV dir=ltr>We're using gcc 4.1.1 and glibc 2.3.8.</DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr>Regards,</DIV>
<DIV dir=ltr>Mattias Bostrom</DIV></DIV></NOSCRIPT></DIV></NOSCRIPT></br><p style="margin-top:11px;padding-top:3px;background-image: url(http://mail.lycos.co.uk/Images/Mail/_content/dot.gif);background-repeat: repeat-x;background-position: 0px 0px;"><br /><br />
<font face="Verdana" size="1" color="#000000"> Hur träffade du din kärlek? Skicka in er historia och vinn biobiljetter.
<a href="http://spraydate.spray.se/spraydate/">Ta chansen!</a></font></div></body></html>