[U-Boot] [PATCH] mpc83xx: Add -fpic relocation support

Wolfgang Denk wd at denx.de
Tue Oct 12 14:52:18 CEST 2010


Dear Joakim Tjernlund,

In message <1286887081-23172-1-git-send-email-Joakim.Tjernlund at 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


More information about the U-Boot mailing list