Building Firefox with: make -f client.mk profiledbuild Results in: ... /var/tmp/moz-build-dir/dist/bin/xpcshell: error while loading shared libraries: libxul.so: cannot map zero-fill pages: Cannot allocate memory make[4]: *** [prepare-package] Error 127 % readelf -lSW ./libxul.so There are 41 section headers, starting at offset 0x103e7f10: Section Headers: [Nr] Name Type Address Off Size ES Flg Lk Inf Al ... [28] .bss NOBITS 000000000bfaabe0 bfa9be0 80186ae8c 00 WA 0 0 32 Adding Wl,-Map,libxul.map when linking libxul shows: ... .bss..LPBX1 0x000000000ccb3be0 0x800000000 /var/tmp/moz-build-dir/toolkit/library/../components/protobuf/once.i_o .... Reducing once.cpp leads to: % cat test.ii class A { virtual void Run (); }; class B:public A { public: B (); void Run () { } }; void *operator new (unsigned long) __attribute__ ((__externally_visible__)); void *moz_xmalloc (); inline void *operator new (unsigned long) { return moz_xmalloc (); } inline A * NewCallback () { return new B; } % c++ -c -fprofile-generate -fdata-sections -O2 test.ii % readelf -lSW ./test.o | grep "800000000" [11] .bss..LPBX1 NOBITS 0000000000000000 000120 800000000 00 WA 0 0 32
Created attachment 28933 [details] gcc48-pr55650.patch Untested fix.
Author: jakub Date: Thu Dec 13 10:11:39 2012 New Revision: 194470 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=194470 Log: PR gcov-profile/55650 * coverage.c (coverage_obj_init): Return false if no functions are being emitted. * g++.dg/other/pr55650.C: New test. * g++.dg/other/pr55650.cc: New file. Added: trunk/gcc/testsuite/g++.dg/other/pr55650.C trunk/gcc/testsuite/g++.dg/other/pr55650.cc Modified: trunk/gcc/ChangeLog trunk/gcc/coverage.c trunk/gcc/testsuite/ChangeLog
Fixed.
*** Bug 59973 has been marked as a duplicate of this bug. ***
A backport to 4.7-branch looks easy and appropriate. Jakub, can you handle this?
Author: trippels Date: Wed Jan 29 18:36:42 2014 New Revision: 207277 URL: http://gcc.gnu.org/viewcvs?rev=207277&root=gcc&view=rev Log: 2014-01-29 Markus Trippelsdorf <markus@trippelsdorf.de> Backport from mainline 2012-12-13 Jakub Jelinek <jakub@redhat.com> PR gcov-profile/55650 * coverage.c (coverage_obj_init): Return false if no functions are being emitted. * g++.dg/other/pr55650.C: New test. * g++.dg/other/pr55650.cc: New file Added: branches/gcc-4_7-branch/gcc/testsuite/g++.dg/other/pr55650.C branches/gcc-4_7-branch/gcc/testsuite/g++.dg/other/pr55650.cc Modified: branches/gcc-4_7-branch/gcc/ChangeLog branches/gcc-4_7-branch/gcc/coverage.c branches/gcc-4_7-branch/gcc/testsuite/ChangeLog
Fixed by backport.