[U-Boot] [PATCH 6/6] powerpc: Add LINK_OFF calls in early C-code.

Scott Wood scottwood at freescale.com
Tue Nov 23 21:46:51 CET 2010


On Tue, 23 Nov 2010 19:48:51 +0100
Joakim Tjernlund <Joakim.Tjernlund at transmode.se> wrote:

> Only these 2 call sites depends on fixups for my mpc8321 based
> board.
> ---
>  arch/powerpc/cpu/mpc83xx/cpu_init.c |    2 +-
>  arch/powerpc/lib/board.c            |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/cpu/mpc83xx/cpu_init.c b/arch/powerpc/cpu/mpc83xx/cpu_init.c
> index f3b67ae..0437b49 100644
> --- a/arch/powerpc/cpu/mpc83xx/cpu_init.c
> +++ b/arch/powerpc/cpu/mpc83xx/cpu_init.c
> @@ -534,7 +534,7 @@ int prt_83xx_rsr(void)
>  	sep = " ";
>  	for (i = 0; i < n; i++)
>  		if (rsr & bits[i].mask) {
> -			printf("%s%s", sep, bits[i].desc);
> +			printf("%s%s", sep, LINK_OFF(bits[i].desc));
>  			sep = ", ";
>  		}
>  	puts("\n");
> diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c
> index 7b09fb5..9fa99dc 100644
> --- a/arch/powerpc/lib/board.c
> +++ b/arch/powerpc/lib/board.c
> @@ -386,7 +386,7 @@ void board_init_f (ulong bootflag)
>  #endif
>  
>  	for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
> -		if ((*init_fnc_ptr) () != 0) {
> +		if ((LINK_OFF(*init_fnc_ptr)) () != 0) {
>  			hang ();
>  		}
>  	}

"Only these" that you've found so far, for the board you've tried --
is it worth adding another pre-relocation landmine to shrink the image
by 5%?  I don't miss the manual fixups we had to do under the old
relocation scheme.

Please document the specific circumstances in which one would need
to use this (any data-segment pointer before relocation?).

Is a missing LINK_OFF likely to result in a crash, or silent bad
behavior?  Will LINK_OFF be a no-op after relocation?

-Scott



More information about the U-Boot mailing list