[uClibc] RE: [uClibc-cvs] CVS update of uClibc (Rules.makldso/ldso/powerpc/dl-startup.h)

Peter Kjellerstedt peter.kjellerstedt at axis.com
Fri Aug 6 16:29:17 UTC 2004


May I suggest the attached patch instead?
It handles PICFLAG the same way as it was already done 
for other architectures (e.g., CRIS and frv).

//Peter

> -----Original Message-----
> From: uclibc-cvs-bounces at uclibc.org 
> [mailto:uclibc-cvs-bounces at uclibc.org] On Behalf Of Erik Andersen
> Sent: 06 August 2004 18:12
> To: uclibc-cvs at uclibc.org
> Subject: [uClibc-cvs] CVS update of uClibc 
> (Rules.makldso/ldso/powerpc/dl-startup.h)
> 
> 
>     Date: Friday, August 6, 2004 @ 10:11:44
>   Author: andersen
>     Path: /var/cvs/uClibc
> 
> Modified: Rules.mak (1.165 -> 1.166) 
> ldso/ldso/powerpc/dl-startup.h (1.11
>           -> 1.12)
> 
> Joakim Tjernlund writes:
> 
> This patch makes -fpic work for PCC and optimzes the 
> relcation by moving the cache
> flushing stuff to JMP relocs only. Actually PPCs ldso can 
> only handle small
> GOT tables(<=8192 entries)anyhow, so it makes little sense to 
> compile PPC with -fPIC.
> libuClibc shrunk from 340724 to 330780 bytes with -fpic.
> 
> 
> Index: uClibc/Rules.mak
> diff -u uClibc/Rules.mak:1.165 uClibc/Rules.mak:1.166
> --- uClibc/Rules.mak:1.165	Fri Jul 16 14:22:22 2004
> +++ uClibc/Rules.mak	Fri Aug  6 10:11:42 2004
> @@ -88,7 +88,15 @@
>  ARFLAGS:=r
>  
>  OPTIMIZATION:=
> -PICFLAG:=-fPIC
> +
> +# PowerPC can hold 8192 entries in its GOT with -fpic which 
> is more than enough. Therefore use
> +# -fpic which will reduce code size and generates faster code.
> +ifeq ($(strip $(TARGET_ARCH)),powerpc)
> +	PICFLAG:=-fpic
> +else
> +	PICFLAG:=-fPIC
> +endif
> +
>  # Some nice CPU specific optimizations
>  ifeq ($(strip $(TARGET_ARCH)),i386)
>  	OPTIMIZATION+=$(call check_gcc,-mpreferred-stack-boundary=2,)
> Index: uClibc/ldso/ldso/powerpc/dl-startup.h
> diff -u uClibc/ldso/ldso/powerpc/dl-startup.h:1.11 
> uClibc/ldso/ldso/powerpc/dl-startup.h:1.12
> --- uClibc/ldso/ldso/powerpc/dl-startup.h:1.11	Tue Apr 
> 20 00:33:03 2004
> +++ uClibc/ldso/ldso/powerpc/dl-startup.h	Fri Aug  6 10:11:43 2004
> @@ -38,15 +38,15 @@
>  	 Elf32_Addr finaladdr=(SYMBOL)+(RELP)->r_addend;\
>  	if (type==R_PPC_RELATIVE) {			\
>  		*REL=(Elf32_Word)(LOAD)+(RELP)->r_addend;\
> +	} else if (type==R_PPC_ADDR32 || type==R_PPC_GLOB_DAT) {\
> +		*REL=finaladdr;				\
>  	} else if (type==R_PPC_JMP_SLOT) {		\
>  		Elf32_Sword delta=finaladdr-(Elf32_Word)(REL);\
>  		*REL=OPCODE_B(delta);			\
> -	} else if (type==R_PPC_ADDR32) {		\
> -		*REL=finaladdr;				\
> +		PPC_DCBST(REL); PPC_SYNC; PPC_ICBI(REL);\
>  	} else {					\
> -	  _dl_exit(100+ELF32_R_TYPE((RELP)->r_info));	\
> +		_dl_exit(100+ELF32_R_TYPE((RELP)->r_info));\
>  	}						\
> -	PPC_DCBST(REL); PPC_SYNC; PPC_ICBI(REL);	\
>  	}
>  /*
>   * Transfer control to the user's application, once the 
> dynamic loader
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rules.patch
Type: application/octet-stream
Size: 1098 bytes
Desc: rules.patch
Url : http://lists.busybox.net/pipermail/uclibc/attachments/20040806/26fab09f/attachment.obj 


More information about the uClibc mailing list