From: Wolfgang Denk Date: Thu, 12 Jun 2003 12:00:13 +0200 Subject: [U-Boot-Users] Relocation of code/data in a dynamic linker absent system. In-Reply-To: Your message of "Thu, 12 Jun 2003 10:30:55 PDT." <005e01c33108$6140c540$6706a8c0@SPLENDOR> Message-ID: <20030612100018.B1C1AC5FD7@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 <005e01c33108$6140c540$6706a8c0@SPLENDOR> you wrote: > > I would like to start a discussion on the various techniques of > relocation of data & code w.r.t to a non-O.S (no dynamic linker) system. > The idea is to compare different thoughts and bring out the best > possibility. The "best" solution often depends on your requirements. Maybe you should first define what you intend to do... I understand that you are talking about statically linked images only, right? > To start with,I myself know of a relocation technique, as used by GNU > toochians : The concept of VMA/LMA... We link the code in such a way > that we have a different execution address(VMA) and a load address(LMA). > All we need to do in our initializaton code is to copy the data/text > from LMA to VMA before we really start using the data/text. Actually this is NOT what we call relocation. Relocation means to modify the instruction and relocation fileds in a relocatable, executable or shared object file to create an executable or shared object file. See the System V ABI / PowerPC Processor Supplement for deatils (setion 4-3 Relocation, section 5-4 Dynamic Linking). Best regards, Wolfgang Denk -- Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: wd at denx.de I thought my people would grow tired of killing. But you were right, they see it is easier than trading. And it has its pleasures. I feel it myself. Like the hunt, but with richer rewards. -- Apella, "A Private Little War", stardate 4211.8