[U-Boot] [PATCH] Align end of bss by 4 bytes,

bss initialization loop increments 4 bytes at a time. And the loop end is checked for an 'equal' condition. Make the bss end address aligned by 4, so that the loop will end as expected.
Adding below lines creates bss of size not aligned to 4 bytes.
typedef struct bss_test__ { unsigned char a1; unsigned char ip1[4]; unsigned char ip2[4]; } bss_test_t;
bss_test_t bss; /* Global variable */
$ ppc_83xx-gcc --version ppc_83xx-gcc (GCC) 4.2.0 (MontaVista 4.2.0-4.0.7.0703741 2007-08-09) Copyright (C) 2007 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $
$ ppc_83xx-readelf -S u-boot | grep bss [ 9] .bss NOBITS fe034000 0335dc 006c9d 00 WA 0 0 8 $
Size of bss is 6c9d bytes.
Signed-off-by: Selvamuthukumar selva.muthukumar@e-coninfotech.com --- cpu/mpc83xx/u-boot.lds | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/cpu/mpc83xx/u-boot.lds b/cpu/mpc83xx/u-boot.lds index 99ad675..0d26937 100644 --- a/cpu/mpc83xx/u-boot.lds +++ b/cpu/mpc83xx/u-boot.lds @@ -117,6 +117,7 @@ SECTIONS *(.bss) *(COMMON) } + . = ALIGN(4); _end = . ; PROVIDE (end = .); } -- 1.5.5

Size of bss is 6c9d bytes.
Signed-off-by: Selvamuthukumar selva.muthukumar@e-coninfotech.com
Ack. Saw similar issues on 85xx.
- k
cpu/mpc83xx/u-boot.lds | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/cpu/mpc83xx/u-boot.lds b/cpu/mpc83xx/u-boot.lds index 99ad675..0d26937 100644 --- a/cpu/mpc83xx/u-boot.lds +++ b/cpu/mpc83xx/u-boot.lds @@ -117,6 +117,7 @@ SECTIONS *(.bss) *(COMMON) }
- . = ALIGN(4);
_end = . ; PROVIDE (end = .); } -- 1.5.5 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot

Dear Selvamuthukumar,
In message b1f9ff350810062049k41ef1a0h3d87989d47385c5f@mail.gmail.com you wrote:
bss initialization loop increments 4 bytes at a time. And the loop end is checked for an 'equal' condition. Make the bss end address aligned by 4, so that the loop will end as expected.
I think this is a problem that may hit probably all architectures & all boards.
Should we not perform this change globally, i. e. to *all* linker scripts?
Best regards,
Wolfgang Denk

Wolfgang Denk,
On Wed, Oct 15, 2008 at 2:28 AM, Wolfgang Denk wd@denx.de wrote:
I think this is a problem that may hit probably all architectures & all boards.
Should we not perform this change globally, i. e. to *all* linker scripts?
Do you expect a patch that touches all linker scripts, that does not do bss alignment? If so, I'll send it.

Dear Selvamuthukumar,
In message b1f9ff350810142305m477bfe9ej75dca2126129b38c@mail.gmail.com you wrote:
Should we not perform this change globally, i. e. to *all* linker scripts?
Do you expect a patch that touches all linker scripts, that does not do bss alignment? If so, I'll send it.
If you could do that, it would be a great help. Thanks in advance!
Best regards,
Wolfgang Denk

Dear Selvamuthukumar,
In message 20081015124401.392EB81C99CF@gemini.denx.de I wrote:
Should we not perform this change globally, i. e. to *all* linker scripts?
Do you expect a patch that touches all linker scripts, that does not do bss alignment? If so, I'll send it.
If you could do that, it would be a great help. Thanks in advance!
Do you have any such patch in the works?
Best regards,
Wolfgang Denk

On Tue, Oct 28, 2008 at 5:19 AM, Wolfgang Denk wd@denx.de wrote:
Dear Selvamuthukumar,
In message 20081015124401.392EB81C99CF@gemini.denx.de I wrote:
Should we not perform this change globally, i. e. to *all* linker scripts?
Do you expect a patch that touches all linker scripts, that does not do bss alignment? If so, I'll send it.
If you could do that, it would be a great help. Thanks in advance!
Do you have any such patch in the works?
http://lists.denx.de/pipermail/u-boot/2008-October/041893.html

Dear Selvamuthukumar,
In message b1f9ff350810272221v669db718ke9a833ec7b66f8cb@mail.gmail.com you wrote:
If you could do that, it would be a great help. Thanks in advance!
Do you have any such patch in the works?
http://lists.denx.de/pipermail/u-boot/2008-October/041893.html
Thanks for the link. Strange, that message doesn't show up in my mailbox :-(
Best regards,
Wolfgang Denk
participants (3)
-
Kumar Gala
-
Selvamuthukumar
-
Wolfgang Denk