Skip to contentSkip to conversation

Command table relocation

U-Boot-Users Chetan Nanda 2 participants 2 messages May 25, 2008

lore
Share & tools
lore
#0 lore raw

Hi All,

In u-boot code (in board.c file) there is a comment which goes like this:

      /*
         * We have to relocate the command table manually
         */

Why we need to relocate the code for command table separately? Does command table code not linked with rest of the code? And where is the linker script that is being used while linking?

Thanks,
Chetan Nanda

#1 lore raw

Hi Nanda,

the command table is (essentially) a vector of pointers to functions (the commands). These pointers are calculated using the TEXTBASE pointer that usually is located into the flash. When relocate the u-boot code, we need to update the commands table with the relocated pointer for e each command in order to use the RAM relocated version of them instead the ROM original copy.

This relocation should be avoided if the relocation offset was known a compilation time... in many board/cpu this is theoretically feasible.

Best regards,

luigi

Il giorno dom, 25/05/2008 alle 19.12 +0530, Chetan Nanda ha scritto:

Quoted 15 lines

Hi All,

In u-boot code (in board.c file) there is a comment which goes like this:

      /*
         * We have to relocate the command table manually
         */

Why we need to relocate the code for command table separately? Does command table code not linked with rest of the code? And where is the linker script that is being used while linking?

Thanks,
Chetan Nanda

Quoted 8 lines

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
U-Boot-Users mailing list
U-Boot-Users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.denx.de/pipermail/u-boot/attachments/20080525/c9f6ef33/attachment.htm