[U-Boot-Users] [PATCH 04/17] i386: Fix global_data declaration

Wolfgang Denk wd at denx.de
Mon May 19 00:36:26 CEST 2008


In message <1211130599-28289-5-git-send-email-plagnioj at jcrosoft.com> you wrote:
> Fix a warning type in lib_i386/board.c

Um... you not only fix a warning; you change the code pretty heavily.

> --- a/lib_i386/board.c
> +++ b/lib_i386/board.c
> @@ -38,6 +38,9 @@
>  #include <ide.h>
>  #include <asm/u-boot-i386.h>
>  
> +gd_t gd_data;
> +gd_t *gd;
> +

Please do not name this 'gd_data'; stick with the 'global_data' name.

Also be aware that this is dangerous - this way it ends up in the BSS
segment which most probably is uninitialized when you acess this data,
and gets overwritten with zeroes some time later.

Is this really working code?

Best regards,

Wolfgang Denk

-- 
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
Inside every old person is a young person wondering what happened.
                              - Terry Pratchett, _Moving Pictures_




More information about the U-Boot mailing list