Date: Sun, 15 Sep 2013 09:14:57 -0500 From: Nathan Whitehorn <nwhitehorn@freebsd.org> To: Eitan Adler <lists@eitanadler.com> Cc: Ian Lepore <ian@freebsd.org>, John-Mark Gurney <jmg@funkthat.com>, "freebsd-arm@freebsd.org" <freebsd-arm@freebsd.org>, freebsd-sparc64 <freebsd-sparc64@freebsd.org>, FreeBSD PowerPC ML <freebsd-ppc@freebsd.org> Subject: Re: Patch for Cross-Reference Phandles Message-ID: <5235C0E1.9080009@freebsd.org> In-Reply-To: <CAF6rxgmiYxEEBtK2Rt0-PoKfu8MP6gow%2B-Ncx7Ma3LFzGd8e9w@mail.gmail.com> References: <522CC7E0.9060508@freebsd.org> <5231D8A6.9080501@freebsd.org> <20130914133155.GA32845@alchemy.franken.de> <52346D71.4080407@freebsd.org> <1379173405.1197.7.camel@revolution.hippie.lan> <20130914172735.GX68682@funkthat.com> <1379181341.1197.26.camel@revolution.hippie.lan> <CAJ-Vmonk_cjc%2BwfCqsHdVESMvRMQTP4c2myK9jZr_%2B59GmWLQQ@mail.gmail.com> <CAF6rxgmiYxEEBtK2Rt0-PoKfu8MP6gow%2B-Ncx7Ma3LFzGd8e9w@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 09/14/13 19:04, Eitan Adler wrote: > [ *please* bottom post ] > > On Sat, Sep 14, 2013 at 7:56 PM, Adrian Chadd <adrian@freebsd.org> wrote: >> ... holy crap. :-) >> >> erm, try writing some code that does something with it: >> >> int foo[2] = { 0, 0 }; >> >> main() >> { >> int i; >> for (i = 0; i < 2; i++) { >> foo[i] = i; >> } >> } >> >> .. and then make foo[2] be foo[512] and explicitly set it up to be zero'ed. >> see what happens. > With an explicit zeroing: > > text data bss dec hex filename > 1572 484 16 2072 818 a.out > > Without: > > text data bss dec hex filename > 1572 484 16 2072 818 a.out > _______________________________________________ > freebsd-ppc@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-ppc > To unsubscribe, send any mail to "freebsd-ppc-unsubscribe@freebsd.org" There's an explanation of this behavior attached to the -fno-zero-initialized-in-bss argument to GCC. I've pasted the relevant section of the man page below: -fno-zero-initialized-in-bss If the target supports a BSS section, GCC by default puts variables that are initialized to zero into BSS. This can save space in the resulting code. This option turns off this behavior because some programs explic- itly rely on variables going to the data section. E.g., so that the resulting executable can find the beginning of that section and/or make assumptions based on that. The default is -fzero-initialized-in-bss. This is why I wasn't worried about the = 0... -Nathan
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5235C0E1.9080009>