From: Mattias Bostrom <mabos@spray.se>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] static function pointers and reallocation
Date: Fri, 2 Nov 2007 13:19:06 +0000 [thread overview]
Message-ID: <170212925751693@lycos-europe.com> (raw)
Hi,
?
We have?a custom board based on Lite5200B and started our development from Freescales BSP including U-Boot 1.1.5.
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.
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?
Or do I have to initialize the vector with function pointers in runtime to get the correct adress?
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.
Is there a "best practice" for function pointers and U-Boot?
We're using gcc 4.1.1 and glibc 2.3.8.
?
Regards,
Mattias Bostrom
Hur tr?ffade du din k?rlek? Skicka in er historia och vinn biobiljetter. http://www.spraydate.se
next reply other threads:[~2007-11-02 13:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-02 13:19 Mattias Bostrom [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-11-02 7:33 [U-Boot-Users] static function pointers and reallocation Mattias Bostrom
2007-11-02 14:40 ` Wolfgang Denk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=170212925751693@lycos-europe.com \
--to=mabos@spray.se \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox