[PATCH 00/13] Clean malloc() implementation

Juergen Beisert jbe at pengutronix.de
Tue Nov 24 05:31:31 EST 2009


On Montag, 23. November 2009, Alessandro Rubini wrote:
> BTW: about initializing globals to 0, I think the compiler habe
> already been putting them in BSS for a few years, though older
> versions didn't do that.

You are right. Checked with my gcc-4.1.2

(test.c)
[...]
int initialized_var = 0;
int uninitialized_var;
[...]

$ nm test
[...]
080495b8 B initialized_var
080495bc B uninitialized_var

[...]
int initialized_var = 1;
int uninitialized_var;
[...]

$ nm test
[...]
080495b4 D initialized_var
080495bc B uninitialized_var

I haven't been knowing that. Thanks.

jbe

-- 
Pengutronix e.K.                              | Juergen Beisert             |
Linux Solutions for Science and Industry      | Phone: +49-8766-939 228     |
Vertretung Sued/Muenchen, Germany             | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686              | http://www.pengutronix.de/  |




More information about the barebox mailing list