From mboxrd@z Thu Jan 1 00:00:00 1970 From: Graeme Russ Date: Sat, 27 Mar 2010 22:54:03 +1100 Subject: [U-Boot] [RFC][PATCH 00/21] [x86] 'Comming of Age' In-Reply-To: References: <1269516183-9306-1-git-send-email-graeme.russ@gmail.com> <1269618919.3376.20364.camel@localhost.localdomain> <4BAD8A9B.2070302@gmail.com> Message-ID: <4BADF1DB.3010404@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Joakim Tjernlund wrote: >> In the near future, I intend to make it 100% relocatable (i.e. does not >> need to be loaded at TEXT_BASE) and maybe even add the ability to specify >> the relocation address. > > I did a few months ago for MPC83xx and sent it to the list. There was some > discussion but in the end it wasn't applied because it was too invasive. > PPC is especially bad as it needs to relocate string literals too. > > Search for LINK_OFF if you want to see what I did > Yes, I saw a bit of that thread and you patches an I would agree that they were too invasive. x86 is not that great for relocation either (all calls are absolute as well as references to .text). Have a look at board_init_f() in lib_i386\board.c - it has a very basic parsing of the ELF relocation information. I tried to champion this as a cross-platform method of achieving full relocation and the killing off of all those ugly reloc_off hacks all over the place. Unfortunately, I think the code size and time penalty may have been too great in the end. To implement full relocation, I simply need to add an additional parameter to this function which provides the 'link versus load' offset which will get applied to the 'load versus run' offset calculation