Bug 537857 part 2 - Avoid --gc-sections removing anything from elfhack test case. r=tglek
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 28 Jun 2011 08:25:48 +0200
changeset 71913 ebb9315861a417e712838ead036867b48531595b
parent 71912 e986c0494f1a8797a39497023dd4351f844998e0
child 71914 2ac11e401c5621530035432d018c59ac77d33ab3
push id20627
push userjdrew@mozilla.com
push dateTue, 28 Jun 2011 16:13:51 +0000
treeherdermozilla-central@d173bf22c9bb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstglek
bugs537857
milestone7.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 537857 part 2 - Avoid --gc-sections removing anything from elfhack test case. r=tglek
build/unix/elfhack/test.c
--- a/build/unix/elfhack/test.c
+++ b/build/unix/elfhack/test.c
@@ -74,16 +74,17 @@ DEF(cheat)
 DEF(by)
 DEF(including)
 DEF(these)
 DEF(phrases)
 DEF(several)
 DEF(times)
 
 #else
+#pragma GCC visibility push(default)
 #include <stdlib.h>
 #include <stdio.h>
 
 #define DEF(w) static const char str_ ## w[] = #w;
 #include "test.c"
 #undef DEF
 
 const char *strings[] = {
@@ -104,17 +105,17 @@ const char *strings2[] = {
 #include "test.c"
 #include "test.c"
 #include "test.c"
 #undef DEF
 };
 
 static int ret = 1;
 
-__attribute__((visibility("default"))) int print_status() {
+int print_status() {
     fprintf(stderr, "%s\n", ret ? "FAIL" : "PASS");
     return ret;
 }
 
 /* On ARM, this creates a .tbss section before .init_array, which
  * elfhack could then pick instead of .init_array.
  * Also, when .tbss is big enough, elfhack may wrongfully consider
  * following sections as part of the PT_TLS segment. */
@@ -144,9 +145,10 @@ static int ret = 1;
 #include "test.c"
 #undef DEF
     if (i != sizeof(strings)/sizeof(strings[0]) &&
         j != sizeof(strings2)/sizeof(strings2[0]))
         fprintf(stderr, "WARNING: Test doesn't cover the whole array\n");
     end_test();
 }
 
+#pragma GCC visibility pop
 #endif