[U-Boot-Users] GOT pointer in U-boot

Wolfgang Denk wd at denx.de
Fri Nov 5 15:22:38 CET 2004


In message <cmfvr3$61o$1 at 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

-- 
See us @ Embedded/Electronica Munich, Nov 09 - 12, Hall A.6 Booth 513
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The more sins you confess, the more books you will sell.




More information about the U-Boot mailing list