From mboxrd@z Thu Jan 1 00:00:00 1970 From: Albert ARIBAUD Date: Tue, 12 Oct 2010 19:41:58 +0200 Subject: [U-Boot] [PATCH] mpc83xx: Add -fpic relocation support In-Reply-To: References: <1286887081-23172-1-git-send-email-Joakim.Tjernlund@transmode.se> <20101012125218.6ABE21508A2@gemini.denx.de> <20101012105258.372089f5@udp111988uds.am.freescale.net> Message-ID: <4CB49DE6.5060801@free.fr> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Le 12/10/2010 19:11, Joakim Tjernlund a ?crit : > Figured I should mention that I have added -msingle-pic-base(from ARM) > which > works nicely with -fpic(not sure if -fPIC is possible) and reduces size > even more: Since you seem to be following the same path as I did on ARM, I may as well ask: did you try removing -fPIC and -msingle-pic-base from compile options and adding -pie to the link options instead? Link option -pie generates ELF relocation and, on ARM at least, does a better job than GOT reloc, which does not fix handle pointers in initialized data while ELF reloc fixes them. And since ELF reloc does not modify code (it is a linker option), you end up with the same size for text+data+rodata. You do have a bigger FLASH image though, because the ELF reloc tables are bigger than the GOT table; but you can git rid of them / not copy them to RAM once relocated. The move from -fPIC to ELF on ARM can be looked for in the elf_reloc branch of the u-boot-arm repo. Amicalement, -- Albert.