From: Wolfgang Denk Date: Fri, 05 Nov 2004 15:22:38 +0100 Subject: [U-Boot-Users] GOT pointer in U-boot In-Reply-To: Your message of "Fri, 05 Nov 2004 19:09:23 +0530." Message-ID: <20041105142243.0D34FC1430@atlas.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de In message 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.