Sourceware Bugzilla – Bug 11618
Add an option to page-align .bss
Last modified: 2010-06-02 20:07:25 UTC
The dynamic linker memset(0)ing .bss causes an extra pagefault due to the
kernel's COW. For firefox 10% of our cold startup page faults are caused by
memset(0)ing .bss once for every library.
One could stick prelink data, .gnu.* metadata, etc infront of .bss to minimize
[You did not mention which target architecture(s) you are interested in, so I
have just tested the following on an x86 host].
There should be no need to add a new command line option to the linker.
Instead you can make use of the existing linker script facilities. Try this:
% cat align_bss.ld
. = ALIGN (CONSTANT (MAXPAGESIZE));
INSERT BEFORE .bss;
Then just add "-Wl,-Talign_bss.ld" to the firefox final link command line.
Is there also a way to page-pad .data ld.so zeros end of .data to end of mmaping.