From: Wolfgang Denk Date: Tue, 12 Oct 2010 14:52:18 +0200 Subject: [U-Boot] [PATCH] mpc83xx: Add -fpic relocation support In-Reply-To: <1286887081-23172-1-git-send-email-Joakim.Tjernlund@transmode.se> References: <1286887081-23172-1-git-send-email-Joakim.Tjernlund@transmode.se> Message-ID: <20101012125218.6ABE21508A2@gemini.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 Dear Joakim Tjernlund, In message <1286887081-23172-1-git-send-email-Joakim.Tjernlund@transmode.se> you wrote: > This add relocation of .got entries produced > by -fpic. -fpic produces 2-3% smaller code and > is faster. Unfortunately gcc promotes -fpic to > -fPIC when -mrelocatable is used so one need a very > small patch to gcc too(sent upstream). What happens when one uses this patch in combination with a "standard" (i. e. older, unpatched) GCC? > START_GOT > GOT_ENTRY(_GOT2_TABLE_) > + GOT_ENTRY(_GOT_TABLE_) > + GOT_ENTRY(_GLOBAL_OFFSET_TABLE_) > GOT_ENTRY(__bss_start) > GOT_ENTRY(_end) > > @@ -951,6 +953,22 @@ in_ram: > stw r0,0(r3) > 2: bdnz 1b > > + lwz r4,GOT(_GLOBAL_OFFSET_TABLE_) What exactly is _GLOBAL_OFFSET_TABLE_ good for, and how does it differ from _GOT_TABLE_ ? Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Perfection is reached, not when there is no longer anything to add, but when there is no longer anything to take away. - Antoine de Saint-Exupery