Skip to contentSkip to conversation

Align end of bss by 4 bytes,

PATCH New Selvamuthukumar 4 participants 10 messages Oct 6, 2008 – Nov 18, 2008 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 1223301492-21964-1-git-send-email-selva.muthukumar@e-coninfotech.com

#1 lore raw

PATCH 1/1 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.

---
 cpu/mpc83xx/u-boot.lds |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
cpu/mpc83xx/u-boot.lds +1 -0
index 99ad675..0d26937 100644
@@ -117,6 +117,7 @@ SECTIONS
   *(.bss)
   *(COMMON)
  }
+  . = ALIGN(4);
  _end = . ;
  PROVIDE (end = .);
 }

--
1.5.5

#2 lore raw

PATCH 1/1 Align end of bss by 4 bytes,

Quoted 5 lines · On Mon, 6 Oct 2008 21:12:58 +0530 Selvamuthukumar…

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 need a signed-off-by to apply this.

also, providing more details in the commit message as to how this condition is being triggered, what happens with which toolchain when it does would be appreciated.

Kim

Quoted 17 lines
 cpu/mpc83xx/u-boot.lds |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
cpu/mpc83xx/u-boot.lds +1 -1
index 99ad675..0d26937 100644
@@ -117,6 +117,7 @@ SECTIONS
   *(.bss)
   *(COMMON)
  }
+  . = ALIGN(4);
  _end = . ;
  PROVIDE (end = .);
 }
--

1.5.5

#3 lore raw

PATCH 1/1 Align end of bss by 4 bytes,

In reply to a message not in the archive

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.

---
 cpu/mpc83xx/u-boot.lds |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
cpu/mpc83xx/u-boot.lds +1 -0
index 99ad675..0d26937 100644
@@ -117,6 +117,7 @@ SECTIONS
   *(.bss)
   *(COMMON)
  }
+  . = ALIGN(4);
  _end = . ;
  PROVIDE (end = .);
 }

--
1.5.5

#4 lore raw

PATCH 1/1 Align end of bss by 4 bytes,

Quoted 4 lines

Size of bss is 6c9d bytes.

Ack. Saw similar issues on 85xx.

- k

Quoted 23 lines

---
cpu/mpc83xx/u-boot.lds | 1 +

1 files changed, 1 insertions(+), 0 deletions(-)
cpu/mpc83xx/u-boot.lds +1 -1
index 99ad675..0d26937 100644
@@ -117,6 +117,7 @@ SECTIONS
  *(.bss)
  *(COMMON)
 }
+  . = ALIGN(4);
 _end = . ;
 PROVIDE (end = .);
 }
--

1.5.5
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#5 lore raw

PATCH 1/1 Align end of bss by 4 bytes,

In reply to Selvamuthukumar

Dear Selvamuthukumar,

Quoted 4 lines · In message <[email protected]> you…

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

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The world is no nursery.                              - Sigmund Freud
#6 lore raw

PATCH 1/1 Align end of bss by 4 bytes,

Wolfgang Denk,

Quoted 6 lines · Wolfgang Denk

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.

Signature · 1 line
Selvamuthukumar
#7 lore raw

PATCH 1/1 Align end of bss by 4 bytes,

Dear Selvamuthukumar,

Quoted 6 lines · In message <[email protected]> you…
Quoted 3 lines

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

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Q:  How many DEC repairman does it take to fix a flat ?
A:  Five; four to hold the car up and one to swap tires.
#8 lore raw

PATCH 1/1 Align end of bss by 4 bytes,

Dear Selvamuthukumar,

Quoted 8 lines · In message <[email protected]> I wrote:
Quoted 6 lines
Quoted 3 lines

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

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"The X11 source code style is ATROCIOUS and should not be used  as  a
model."                                                   - Doug Gwyn
#9 lore raw

PATCH 1/1 Align end of bss by 4 bytes,

Quoted 7 lines · Wolfgang Denk

Dear Selvamuthukumar,

Quoted 4 lines · In message <[email protected]> I wrote:
Quoted 4 lines
Quoted 3 lines

Should we not perform this change globally, i. e. to *all* linker scripts?

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

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

Signature · 1 line
Selvamuthukumar
#10 lore raw

PATCH 1/1 Align end of bss by 4 bytes,

Dear Selvamuthukumar,

Quoted 7 lines · In message <[email protected]> you…
Quoted 5 lines
Quoted 2 lines

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

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The use of anthropomorphic terminology when  dealing  with  computing
systems is a symptom of professional immaturity.   -- Edsger Dijkstra