Bug 1385117 - Make the bss section of the elfhack testcase large enough. r=froydnj
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 28 Jul 2017 07:15:39 +0900
changeset 422621 5eb7c3c68777074fe12adcbc4152859680011b1e
parent 422620 d2ae1aa2d341d4a6fdfa72f3a89e7c4c59fe6252
child 422622 465b7a02cb336ac45c43664f2198bf6cd225132b
push id1517
push userjlorenzo@mozilla.com
push dateThu, 14 Sep 2017 16:50:54 +0000
treeherdermozilla-release@3b41fd564418 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1385117, 635961
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1385117 - Make the bss section of the elfhack testcase large enough. r=froydnj Since bug 635961, building with relro makes elfhack try to use the bss data for a temporary function pointer. If there is not enough space for a pointer in the bss, elfhack will complain it couldn't find the bss. In normal circumstances, this is most likely fine. Libraries with a bss so small that it can't fit a pointer are already too small to be elfhacked anyways. In Firefox, the two libraries with the smallest bss have enough space for two pointers, and aren't elfhacked (libmozgtk.so and libplds4.so). However, the testcase that is used during the build to validate that elfhack works doesn't have a large enough bss on x86-64, making elfhack bail out, and the build fail as a consequence. This, in turn, is due to the only non-thread-local zeroed data being an int, which is not enough to fit a pointer on x86-64. We thus make it a size_t.
build/unix/elfhack/test.c
--- a/build/unix/elfhack/test.c
+++ b/build/unix/elfhack/test.c
@@ -125,17 +125,17 @@ int print_status() {
  * following sections as part of the PT_TLS segment.
  * Finally, gold makes TLS segments end on an aligned virtual address,
  * even when the underlying section ends before that, and elfhack
  * sanity checks may yield an error. */
 __thread int foo;
 __thread long long int bar[512];
 
 void end_test() {
-    static int count = 0;
+    static size_t count = 0;
     /* Only exit when both constructors have been called */
     if (++count == 2)
         ret = 0;
 }
 
 void test() {
     int i = 0, j = 0;
 #define DEF_(a,i,w) \