[U-Boot-Users] Why are some global vars part of the image, and some not?

Wolfgang Denk wd at denx.de
Sat Nov 4 00:47:50 CET 2006


In message <454BC07C.4090704 at freescale.com> you wrote:
>
> > #ifdef CFG_SPD_BUS_NUM
> > static volatile unsigned int i2c_bus_num = CFG_SPD_BUS_NUM;
> > #else
> > static volatile unsigned int i2c_bus_num = 0;
> > #endif
> 
> Ok, I fixed my problem by changing the above line to:

I don't see any problem that needed fixing.

> static volatile unsigned int i2c_bus_num __attribute__ ((section ("data"))) = 0;
> 
> Is "data" the right section to use?  Here's my lds file:

If you have to ask this question, then the answer is no,  and  better
don't mess with things you don't understand.

What exactly is the "problem" you are experiencing? Did you read  the
documentation, especially section "Initial Stack, Global Data" in the
README? Please let me know if there is anything in this text which is
not clear enough.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Behind every great man, there is a woman -- urging him on.
	-- Harry Mudd, "I, Mudd", stardate 4513.3




More information about the U-Boot mailing list