
Wolfgang Denk wd@denx.de wrote on 2011/04/24 22:48:09:
Dear Joakim Tjernlund,
In message 1303633774-22961-4-git-send-email-Joakim.Tjernlund@transmode.se you wrote:
Seems like recent linker/fpic changes broke a few 8xx boards. This makes them build again.
Signed-off-by: Joakim Tjernlund Joakim.Tjernlund@transmode.se
board/LEOX/elpt860/u-boot.lds | 2 +- board/etx094/u-boot.lds | 2 +- board/svm_sc8xx/u-boot.lds | 2 +- board/tqc/tqm8xx/u-boot.lds | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-)
Sorry, but isn't this just papering over the original problem? In the reverted commit you claimed:
-msingle-pic-base is a new gcc option for ppc and it reduces the size of my u-boot with 6-8 KB. While at it, add -fno-jump-tables too to save a few more bytes.
This promises to reduce the overall code size, but instead the observation is that it is growing, which is the reson for the build problem on some boards.
Well, your gcc is different from mine and I know nothing about it as you won't say anything about it. This is what I get:
With -msingle-pic-base:
## 4.4.5 has been patched to support msingle-pic-base CROSS_COMPILE=powerpc-4.4.5_softfloat-linux-gnu- ./MAKEALL TQM855L TQM860L Configuring for TQM855L board... text data bss dec hex filename 267022 5284 27200 299506 491f2 ./u-boot Configuring for TQM860L board... text data bss dec hex filename 267043 5284 27200 299527 49207 ./u-boot
##powerpc-softfloat-linux-gnu- is 3.4.6 CROSS_COMPILE=powerpc-softfloat-linux-gnu- ./MAKEALL TQM855L TQM860L Configuring for TQM855L board... u-boot.lds:90 cannot move location counter backwards (from 00000000400081d4 to 0000000040008000) make: *** [u-boot] Error 1 powerpc-softfloat-linux-gnu-size: './u-boot': No such file Configuring for TQM860L board... u-boot.lds:90 cannot move location counter backwards (from 00000000400081e0 to 0000000040008000) make: *** [u-boot] Error 1 powerpc-softfloat-linux-gnu-size: './u-boot': No such file
Reverted -msingle-pic-base:
CROSS_COMPILE=powerpc-4.4.5_softfloat-linux-gnu- ./MAKEALL TQM855L TQM860L Configuring for TQM855L board... u-boot.lds:75 cannot move location counter backwards (from 40008180 to 40008000) make: *** [u-boot] Error 1 powerpc-4.4.5_softfloat-linux-gnu-size: './u-boot': No such file Configuring for TQM860L board... u-boot.lds:75 cannot move location counter backwards (from 40008190 to 40008000) make: *** [u-boot] Error 1 powerpc-4.4.5_softfloat-linux-gnu-size: './u-boot': No such file
CROSS_COMPILE=powerpc-softfloat-linux-gnu- ./MAKEALL TQM855L TQM860L Configuring for TQM855L board... u-boot.lds:90 cannot move location counter backwards (from 00000000400081d4 to 0000000040008000) make: *** [u-boot] Error 1 powerpc-softfloat-linux-gnu-size: './u-boot': No such file Configuring for TQM860L board... u-boot.lds:90 cannot move location counter backwards (from 00000000400081e0 to 0000000040008000) make: *** [u-boot] Error 1 powerpc-softfloat-linux-gnu-size: './u-boot': No such file
So I strongly suspect that as soon as you move your gcc version upwards, it will break these boards too.
For example TQM860L (top of tree, with 8c4734e reverted (i. e. your old 39768f7 reapplied) and this patch here applied, I see:
text data bss dec hex filename 258663 14676 27228 300567 49617 ./u-boot
and
0x00008000 . = DEFINED (env_offset)?env_offset:.
*fill* 0x40007d28 0x2d8 00 common/env_embedded.o(.ppcenv*) .ppcenv 0x40008000 0x8000 common/env_embedded.o
Without these two changes we have:
text data bss dec hex filename 257955 14744 27228 299927 49397 ./u-boot
and
670 0x00008000 . = DEFINED (env_offset)?env_offset:. 671 *fill* 0x40007fb4 0x4c 00 672 common/env_embedded.o(.ppcenv*) 673 .ppcenv 0x40008000 0x8000 common/env_embedded.o
The gap before the embedded environment which is just 76 bytes without your patches now grows to 728 bytes (i. e. by a factor of nearly 10), and the total image sie grows, too.
Of course, I had for these boards move something from the small space before the environment as some gcc's produce larger code so the targeted space was too small, something had to give.
I will not apply either of these commits - neither the reverted one, nor this additional one, as both of them grow the memory footprint instead of redusing it as you promised in the commit message.
You should read the commit msg again. It requires a gcc which supports -msingle-pic-base. I still don't know why it broke with your gcc but I suspect it is due to -fno-jump-tables(which is in the msingle-pic-base patch). Seems like that option in your case makes the code bigger.
Jocke