
In message cmfvr3$61o$1@sea.gmane.org you wrote:
I understand that global pointer is adjusted with respect to end of u-boot data. But there is a reference to GLOBAL_OFFSET_TABLE in cpu/mips/start.S whose contents are assigned to "gp" in the code. My code does not have the memory location which gp points to ? How should I find out what should be the contents of gp ? README file does mention the use of global pointers but it does not have a reference to GOT pointer.
These are compiler / linker internals. In short: for position independent or relocatable code, GCC will generate accesses to all constant addresses through a global offset table (GOT). The loader resolves the GOT entries when the program starts, or - in case of U-boot - we manually adjustt he GOT when relocating the image to RAM.
You will need to dig into the GCC / ld documentation if you really want to understand what's going on there. [On the other hand it's usually safe to ignore this; the relevant problems have already been solved for MIPS and the other supported architectures.]
Best regards,
Wolfgang Denk