Add include for config.h in command.h.
PATCH 1/1 Add include for config.h in command.h.
Because the cmd_tbl_s structure depends on the configuration file, it must be assured that config.h is included before the structure is evaluated by the compiler. If this is not certain, it could happen that the compiler generates structures of different size, depending on the fact if the source file includes <config.h> before or after <command.h>.
The effect is that u-boot crashes when tries to relocate the command table (for ppc) or try to access to the command table for other architectures.
The problem can happen on board-depending commands.All general commands under /common are unaffected, because they include already config.h before command.h.
--- include/command.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
include/command.h +2 -0
@@ -31,6 +31,8 @@#define NULL 0#endif +#include <config.h> +#ifndef __ASSEMBLY__/* * Monitor Command Table
Signature · 1 line
1.5.4.3
[U-Boot-Users] unassigned-patches/6: [PATCH] Add include for config.h in command.h.
Because the cmd_tbl_s structure depends on the configuration file, it must be assured that config.h is included before the structure is evaluated by the compiler. If this is not certain, it could happen that the compiler generates structures of different size, depending on the fact if the source file includes <config.h> before or after <command.h>.
The effect is that u-boot crashes when tries to relocate the command table (for ppc) or try to access to the command table for other architectures.
The problem can happen on board-depending commands.All general commands under /common are unaffected, because they include already config.h before command.h.
---
Added to GNATS database as unassigned-patches/6
Quoted 5 lines
Responsible: patch-coord Message-Id: <[email protected]> In-Reply-To: <> References: <> Patch-Date: Thu Jul 24 16:22:25 +0200 2008
--- include/command.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
include/command.h +2 -0
@@ -31,6 +31,8 @@#define NULL 0#endif +#include <config.h> +#ifndef __ASSEMBLY__/* * Monitor Command Table
Signature · 12 lines
1.5.4.3 ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ U-Boot-Users mailing list U-Boot-Users at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
PATCH 1/1 Add include for config.h in command.h.
In reply to Stefano BabicQuoted 4 lines · In message <[email protected]> you wrote:
Because the
cmd_tbl_sstructure depends on the configuration file, it must be assured thatconfig.his included before the structure is evaluated by the compiler. If this is not certain, it could happen that the compiler generates structures of different size, depending
Quoted 8 lines
on the fact if the source file includes <
config.h> before or after <command.h>.
The effect is that u-boot crashes when tries to relocate the command table (for ppc) or try to access to the command table for other architectures.
The problem can happen on board-depending commands.All general commands under /common are unaffected, because they include alreadyconfig.hbeforecommand.h.
Agreed in principle, but...
Quoted 10 lines
Signed-off-by Stefano Babic <[email protected]>--- include/command.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)include/command.h +0
-0
include/command.h line 35
Quoted 5 lines
include/command.h +2
-0@@ -31,6 +31,8 @@#define NULL 0#endif +#include <config.h> +
...please move the #include *before* the #define.
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
A good marriage would be between a blind wife and deaf husband.
-- Michel de MontaigneWolfgang Denk
AppliedPATCH 1/1 Add include for config.h in command.h.
In reply to Stefano BabicQuoted 13 lines · In message <[email protected]> you wrote:
Because the
cmd_tbl_sstructure depends on the configuration file, it must be assured thatconfig.his included before the structure is evaluated by the compiler. If this is not certain, it could happen that the compiler generates structures of different size, depending on the fact if the source file includes <config.h> before or after <command.h>.
The effect is that u-boot crashes when tries to relocate the command table (for ppc) or try to access to the command table for other architectures.
The problem can happen on board-depending commands.All general commands under /common are unaffected, because they include alreadyconfig.hbeforecommand.h.
Quoted 4 lines
Signed-off-by Stefano Babic <[email protected]>--- include/command.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
Applied, thanks.
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 greatest threat towards future is indifference.