RE: Zero Initialized in BSS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I think what the kernel-hacking guides are getting at is that it has
already effectively been initialised to zero, therefore doing it again
is just a waste of processor cycles.

That makes sense, but it still confuses me as to the issue. The kernel is compiled at -O2 or -Os, if I haven't mis-read the Makefiles. If GCC is smart enough to move zero-initialized static variables from the data section to the bss section, why would it even retain the initialization instruction in the assembly?

It's not an issue for me to simply not include structure members in an initialization if they're zero, but there are a few things (like THIS_MODULE) that evaluate to zero at times. Does compiling the entire kernel as built-in without modules also include a bunch of useless assignments to zero, one per module?

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux