Bug 935676 - Stub out missing Flash symbols. r=glandium, a=bajaj
authorJames Willcox <snorp@snorp.net>
Wed, 15 Jan 2014 09:16:33 -0600
changeset 175852 a30a7a20eaf43db68b290135b7aa1246a10c6316
parent 175851 67e3616f0b17d189745eb09465dcf05397cc5a5b
child 175853 448e768c4038accd4743e5eb6ef94d0de030eebc
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium, bajaj
bugs935676
milestone28.0a2
Bug 935676 - Stub out missing Flash symbols. r=glandium, a=bajaj
mozglue/linker/CustomElf.cpp
--- a/mozglue/linker/CustomElf.cpp
+++ b/mozglue/linker/CustomElf.cpp
@@ -59,16 +59,21 @@ void debug_phdr(const char *type, const 
             "memsz: 0x%08" PRIxAddr ", "
             "offset: 0x%08" PRIxAddr ", "
             "flags: %c%c%c)",
             type, phdr->p_vaddr, phdr->p_filesz, phdr->p_memsz,
             phdr->p_offset, phdr->p_flags & PF_R ? 'r' : '-',
             phdr->p_flags & PF_W ? 'w' : '-', phdr->p_flags & PF_X ? 'x' : '-');
 }
 
+void
+__void_stub(void)
+{
+}
+
 } /* anonymous namespace */
 
 /**
  * RAII wrapper for a mapping of the first page off a Mappable object.
  * This calls Mappable::munmap instead of system munmap.
  */
 class Mappable1stPagePtr: public GenericMappedPtr<Mappable1stPagePtr> {
 public:
@@ -316,16 +321,26 @@ CustomElf::GetSymbolPtrInDeps(const char
     if (strcmp(symbol + 2, "moz_linker_stats") == 0)
       return FunctionPtr(&ElfLoader::stats);
 #ifdef __ARM_EABI__
     if (strcmp(symbol + 2, "gnu_Unwind_Find_exidx") == 0)
       return FunctionPtr(__wrap___gnu_Unwind_Find_exidx);
 #endif
   }
 
+#define MISSING_FLASH_SYMNAME_START "_ZN7android10VectorImpl19reservedVectorImpl"
+
+  // Android changed some symbols that Flash depended on in 4.4,
+  // so stub those out here
+  if (strncmp(symbol,
+              MISSING_FLASH_SYMNAME_START,
+              sizeof(MISSING_FLASH_SYMNAME_START) - 1) == 0) {
+    return FunctionPtr(__void_stub);
+  }
+
   void *sym;
   /* Search the symbol in the main program. Note this also tries all libraries
    * the system linker will have loaded RTLD_GLOBAL. Unfortunately, that doesn't
    * work with bionic, but its linker doesn't normally search the main binary
    * anyways. Moreover, on android, the main binary is dalvik. */
 #ifdef __GLIBC__
   sym = dlsym(RTLD_DEFAULT, symbol);
   DEBUG_LOG("dlsym(RTLD_DEFAULT, \"%s\") = %p", symbol, sym);