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

2010-10-13 Thread Albert ARIBAUD
Le 13/10/2010 23:25, Joakim Tjernlund a écrit : > Does -msingle-pic-base work on ARM for both -fpic and -fPIC? > I have a hard time making -fPIC work, I think it isn't possible > with the current impl. of -fPIC on ppc. > > Jocke From what I remember, there was no difference between object file

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

2010-10-13 Thread Joakim Tjernlund
> > Albert ARIBAUD wrote on 2010/10/13 11:05:09: > > > > Le 13/10/2010 09:07, Joakim Tjernlund a écrit : > > > > > Did you use -msingle-pic-base too with -fpic/-fPIC? This is what makes > > > a difference(together with -fpic). The most interesting size is > > > the total flash size IMHO. Reduc

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

2010-10-13 Thread Joakim Tjernlund
Kim Phillips wrote on 2010/10/12 21:54:10: > > On Tue, 12 Oct 2010 21:17:38 +0200 > Joakim Tjernlund wrote: > > > > Yes, it is a simple symbol to add. I will do it twm if you don't > > > beat me to it. it would be nice if you could try what works > > > and not though. > > > > Could not wait, d

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

2010-10-13 Thread Joakim Tjernlund
Albert ARIBAUD wrote on 2010/10/13 11:05:09: > > Le 13/10/2010 09:07, Joakim Tjernlund a écrit : > > > Did you use -msingle-pic-base too with -fpic/-fPIC? This is what makes > > a difference(together with -fpic). The most interesting size is > > the total flash size IMHO. Reducing insn's in RAM

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

2010-10-13 Thread Albert ARIBAUD
Le 13/10/2010 09:07, Joakim Tjernlund a écrit : > Did you use -msingle-pic-base too with -fpic/-fPIC? This is what makes > a difference(together with -fpic). The most interesting size is > the total flash size IMHO. Reducing insn's in RAM at the expense > of flash is not what most users need I thi

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

2010-10-13 Thread Joakim Tjernlund
> > On 10/12/2010 11:30 PM, Albert ARIBAUD wrote: > > Le 12/10/2010 23:00, Joakim Tjernlund a écrit : > > > >> Yes, but the difference isn't really the arch. It is the -mrelocatable > >> flag that is the big difference. > > Not only: obviously, implementing GOT relocation is not done the same

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

2010-10-13 Thread J. William Campbell
On 10/12/2010 11:30 PM, Albert ARIBAUD wrote: > Le 12/10/2010 23:00, Joakim Tjernlund a écrit : > >> Yes, but the difference isn't really the arch. It is the -mrelocatable >> flag that is the big difference. > Not only: obviously, implementing GOT relocation is not done the same on > both archs,

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

2010-10-13 Thread Joakim Tjernlund
Albert ARIBAUD wrote on 2010/10/13 08:30:33: > > Le 12/10/2010 23:00, Joakim Tjernlund a écrit : > > > Yes, but the difference isn't really the arch. It is the -mrelocatable > > flag that is the big difference. > > Not only: obviously, implementing GOT relocation is not done the same on > bot

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

2010-10-12 Thread Albert ARIBAUD
Le 12/10/2010 23:00, Joakim Tjernlund a écrit : > Yes, but the difference isn't really the arch. It is the -mrelocatable > flag that is the big difference. Not only: obviously, implementing GOT relocation is not done the same on both archs, and it simply is not beneficial on ARM wrt PPC in terms

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

2010-10-12 Thread Scott Wood
On Tue, 12 Oct 2010 23:23:23 +0200 Joakim Tjernlund wrote: > Any idea if SPL is size optimized to death already or if there is some > low hanging fruits left? There are some things that could be shrunk -- such as hardcoding the page size, removing prints, etc. Still, it would be nice if we coul

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

2010-10-12 Thread Joakim Tjernlund
Kim Phillips wrote on 2010/10/12 21:54:10: > > On Tue, 12 Oct 2010 21:17:38 +0200 > Joakim Tjernlund wrote: > > > > Yes, it is a simple symbol to add. I will do it twm if you don't > > > beat me to it. it would be nice if you could try what works > > > and not though. > > > > Could not wait, d

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

2010-10-12 Thread Joakim Tjernlund
Scott Wood wrote on 2010/10/12 22:48:59: > > On Tue, 12 Oct 2010 22:40:27 +0200 > Joakim Tjernlund wrote: > > > Scott Wood wrote on 2010/10/12 22:16:14: > > > The link address is of the pre-relocation NAND buffer. > > > > hmm, then I don't understand how you get by. Initialized static/global

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

2010-10-12 Thread Joakim Tjernlund
Albert ARIBAUD wrote on 2010/10/12 22:37:54: > > Le 12/10/2010 20:11, Joakim Tjernlund a écrit : > >> > >> 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

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

2010-10-12 Thread Scott Wood
On Tue, 12 Oct 2010 22:40:27 +0200 Joakim Tjernlund wrote: > Scott Wood wrote on 2010/10/12 22:16:14: > > The link address is of the pre-relocation NAND buffer. > > hmm, then I don't understand how you get by. Initialized static/global > ptrs should point into some random area. It suspect we j

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

2010-10-12 Thread Joakim Tjernlund
Scott Wood wrote on 2010/10/12 22:16:14: > > On Tue, 12 Oct 2010 21:51:44 +0200 > Joakim Tjernlund wrote: > > > Scott Wood wrote on 2010/10/12 21:20:26: > > > We do need to relocate with NAND SPL. We start in the NAND buffer, > > > but we have to move to RAM to free up the buffer for loading

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

2010-10-12 Thread Albert ARIBAUD
Le 12/10/2010 20:11, Joakim Tjernlund a écrit : >> >> 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

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

2010-10-12 Thread Scott Wood
On Tue, 12 Oct 2010 21:51:44 +0200 Joakim Tjernlund wrote: > Scott Wood wrote on 2010/10/12 21:20:26: > > We do need to relocate with NAND SPL. We start in the NAND buffer, > > but we have to move to RAM to free up the buffer for loading the rest > > of U-Boot. > > Sure, but do you move to a s

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

2010-10-12 Thread Kim Phillips
On Tue, 12 Oct 2010 21:17:38 +0200 Joakim Tjernlund wrote: > > Yes, it is a simple symbol to add. I will do it twm if you don't > > beat me to it. it would be nice if you could try what works > > and not though. > > Could not wait, does this work for you? > > diff --git a/nand_spl/board/freesca

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

2010-10-12 Thread Joakim Tjernlund
Scott Wood wrote on 2010/10/12 21:20:26: > > On Tue, 12 Oct 2010 21:13:19 +0200 > Joakim Tjernlund wrote: > > > Kim Phillips wrote on 2010/10/12 20:19:38: > > > > > > On Tue, 12 Oct 2010 19:41:56 +0200 > > > Joakim Tjernlund wrote: > > > > > > > Kim Phillips wrote on 2010/10/12 > > 19:31

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

2010-10-12 Thread Scott Wood
On Tue, 12 Oct 2010 21:13:19 +0200 Joakim Tjernlund wrote: > Kim Phillips wrote on 2010/10/12 20:19:38: > > > > On Tue, 12 Oct 2010 19:41:56 +0200 > > Joakim Tjernlund wrote: > > > > > Kim Phillips wrote on 2010/10/12 > 19:31:25: > > > > that moderate size increase in start.S breaks nand bu

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

2010-10-12 Thread Joakim Tjernlund
> > Yes, it is a simple symbol to add. I will do it twm if you don't > beat me to it. it would be nice if you could try what works > and not though. Could not wait, does this work for you? diff --git a/nand_spl/board/freescale/mpc8313erdb/u-boot.lds b/nand_spl/board/freescale/mpc8313erdb/u-boot

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

2010-10-12 Thread Joakim Tjernlund
Kim Phillips wrote on 2010/10/12 20:19:38: > > On Tue, 12 Oct 2010 19:41:56 +0200 > Joakim Tjernlund wrote: > > > Kim Phillips wrote on 2010/10/12 19:31:25: > > > that moderate size increase in start.S breaks nand builds: > > > One thing I wonder about: How come NAND_SPL need GOT2 relocs > >

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

2010-10-12 Thread Joakim Tjernlund
Scott Wood wrote on 2010/10/12 20:25:40: > > On Tue, 12 Oct 2010 13:19:38 -0500 > Kim Phillips wrote: > > > On Tue, 12 Oct 2010 19:41:56 +0200 > > Joakim Tjernlund wrote: > > > > > Kim Phillips wrote on 2010/10/12 19:31:25: > > > > that moderate size increase in start.S breaks nand builds:

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

2010-10-12 Thread Kim Phillips
On Tue, 12 Oct 2010 13:25:40 -0500 Scott Wood wrote: > On Tue, 12 Oct 2010 13:19:38 -0500 > Kim Phillips wrote: > > > On Tue, 12 Oct 2010 19:41:56 +0200 > > Joakim Tjernlund wrote: > > > > > Kim Phillips wrote on 2010/10/12 19:31:25: > > > > that moderate size increase in start.S breaks nand

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

2010-10-12 Thread Scott Wood
On Tue, 12 Oct 2010 13:19:38 -0500 Kim Phillips wrote: > On Tue, 12 Oct 2010 19:41:56 +0200 > Joakim Tjernlund wrote: > > > Kim Phillips wrote on 2010/10/12 19:31:25: > > > that moderate size increase in start.S breaks nand builds: > > > > > > Configuring for MPC8313ERDB_NAND_66 board... > >

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

2010-10-12 Thread Kim Phillips
On Tue, 12 Oct 2010 19:41:56 +0200 Joakim Tjernlund wrote: > Kim Phillips wrote on 2010/10/12 19:31:25: > > that moderate size increase in start.S breaks nand builds: > > > > Configuring for MPC8313ERDB_NAND_66 board... > > start.o:(.got2+0x4): undefined reference to `_GOT_TABLE_' > > make[1]:

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

2010-10-12 Thread Joakim Tjernlund
> > 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,

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

2010-10-12 Thread Joakim Tjernlund
Kim Phillips wrote on 2010/10/12 19:31:25: > > On Tue, 12 Oct 2010 16:10:33 +0200 > Joakim Tjernlund wrote: > > > Wolfgang Denk wrote on 2010/10/12 15:47:19: > > > > > > Dear Joakim Tjernlund, > > > > > > In message > > 0047d...@transmode.se> you wrote: > > > > > > > > > What happens when o

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

2010-10-12 Thread Albert ARIBAUD
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:

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

2010-10-12 Thread Scott Wood
On Tue, 12 Oct 2010 12:31:25 -0500 Kim Phillips wrote: > that moderate size increase in start.S breaks nand builds: > > Configuring for MPC8313ERDB_NAND_66 board... > start.o:(.got2+0x4): undefined reference to `_GOT_TABLE_' > make[1]: *** [/home/r1aaha/git/u-boot/nand_spl/u-boot-spl] Error 1 I

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

2010-10-12 Thread Wolfgang Denk
Dear Scott Wood, In message <20101012105258.37208...@udp111988uds.am.freescale.net> you wrote: > > Maybe call it _GOT_START_ or similar? _GLOBAL_OFFSET_TABLE_ and > _GOT_TABLE_[1] look like synonyms. ... > [1] Global offset table table? :-) Yeah. Please display the GOT table on the LCD display

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

2010-10-12 Thread Kim Phillips
On Tue, 12 Oct 2010 16:10:33 +0200 Joakim Tjernlund wrote: > Wolfgang Denk wrote on 2010/10/12 15:47:19: > > > > Dear Joakim Tjernlund, > > > > In message > 0047d...@transmode.se> you wrote: > > > > > > > What happens when one uses this patch in combination with a > "standard" > > > > (i. e.

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

2010-10-12 Thread Joakim Tjernlund
Scott Wood wrote on 2010/10/12 17:52:58: > > On Tue, 12 Oct 2010 15:04:31 +0200 > Joakim Tjernlund wrote: > > > _GLOBAL_OFFSET_TABLE_ is a predefined symbol that the linker defines to > > be in the middle of the -fpic GOT table. It marks the end of the GOT table > > as far as we are concerned

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

2010-10-12 Thread Scott Wood
On Tue, 12 Oct 2010 15:04:31 +0200 Joakim Tjernlund wrote: > _GLOBAL_OFFSET_TABLE_ is a predefined symbol that the linker defines to > be in the middle of the -fpic GOT table. It marks the end of the GOT table > as far as we are concerned(u-boot does not generate so many relocs that > the > link

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

2010-10-12 Thread Joakim Tjernlund
Wolfgang Denk wrote on 2010/10/12 15:47:19: > > Dear Joakim Tjernlund, > > In message 0047d...@transmode.se> you wrote: > > > > > What happens when one uses this patch in combination with a "standard" > > > (i. e. older, unpatched) GCC? > > > > Nothing, gcc will produce -fPIC relocs and the c

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

2010-10-12 Thread Wolfgang Denk
Dear Joakim Tjernlund, In message you wrote: > > > What happens when one uses this patch in combination with a "standard" > > (i. e. older, unpatched) GCC? > > Nothing, gcc will produce -fPIC relocs and the code will/should just work. OK, so your change means effectively a no-op (except for t

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

2010-10-12 Thread Joakim Tjernlund
Wolfgang Denk wrote on 2010/10/12 14:52:18: > > Dear Joakim Tjernlund, > > In message <1286887081-23172-1-git-send-email-joakim.tjernl...@transmode.se> you wrote: > > This add relocation of .got entries produced > > by -fpic. -fpic produces 2-3% smaller code and > > is faster. Unfortunately gc

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

2010-10-12 Thread Wolfgang Denk
Dear Joakim Tjernlund, In message <1286887081-23172-1-git-send-email-joakim.tjernl...@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

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

2010-10-12 Thread Joakim Tjernlund
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). Signed-off-by: Joakim Tjernlund --- arch/powerpc/cpu/mpc83xx/start