Bug 727959 - Ignore 0xffffffff entries the x86 Android NDK puts in .{init,fini}_array. r=tglek
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 14 Mar 2012 10:53:21 +0100
changeset 92689 8133f0c6fc4efcb3970cd40676a16b488e9f2e2e
parent 92688 10123c7f98e93b497ec211419c991967c91cd561
child 92690 ee2931fcb5aeb6417e54e33d8e604d42c17ba74e
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstglek
bugs727959
milestone14.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 727959 - Ignore 0xffffffff entries the x86 Android NDK puts in .{init,fini}_array. r=tglek
mozglue/linker/CustomElf.cpp
--- a/mozglue/linker/CustomElf.cpp
+++ b/mozglue/linker/CustomElf.cpp
@@ -700,28 +700,30 @@ CustomElf::RelocateJumps()
 bool
 CustomElf::CallInit()
 {
   if (init)
     CallFunction(init);
 
   for (Array<void *>::iterator it = init_array.begin();
        it < init_array.end(); ++it) {
-    if (*it)
+    /* Android x86 NDK wrongly puts 0xffffffff in INIT_ARRAY */
+    if (*it && *it != reinterpret_cast<void *>(-1))
       CallFunction(*it);
   }
   initialized = true;
   return true;
 }
 
 void
 CustomElf::CallFini()
 {
   if (!initialized)
     return;
   for (Array<void *>::iterator it = fini_array.begin();
        it < fini_array.end(); ++it) {
-    if (*it)
+    /* Android x86 NDK wrongly puts 0xffffffff in FINI_ARRAY */
+    if (*it && *it != reinterpret_cast<void *>(-1))
       CallFunction(*it);
   }
   if (fini)
     CallFunction(fini);
 }