Bug 956398 - Only support text relocations for libflashplayer.so. r=nfroyd, a=bajaj
authorMike Hommey <mh+mozilla@glandium.org>
Sat, 25 Jan 2014 07:59:14 +0900
changeset 176021 4b8d14a78596e0b9a2c5eb7f28a1e756408c8536
parent 176020 9bf1936426efc9e3d4940e74a0ea710878fd3bf2
child 176022 cddd640cd774ddff09f82624cd69f88a39dfe4e9
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)
reviewersnfroyd, bajaj
bugs956398
milestone28.0a2
Bug 956398 - Only support text relocations for libflashplayer.so. r=nfroyd, a=bajaj
mozglue/linker/CustomElf.cpp
--- a/mozglue/linker/CustomElf.cpp
+++ b/mozglue/linker/CustomElf.cpp
@@ -571,17 +571,22 @@ CustomElf::InitDyn(const Phdr *pt_dyn)
       case DT_SYMENT:
         debug_dyn("DT_SYMENT", dyn);
         if (dyn->d_un.d_val != sizeof(Sym)) {
           LOG("%s: Unsupported DT_SYMENT", GetPath());
           return false;
         }
         break;
       case DT_TEXTREL:
-        has_text_relocs = true;
+        if (strcmp("libflashplayer.so", GetName()) == 0) {
+          has_text_relocs = true;
+        } else {
+          LOG("%s: Text relocations are not supported", GetPath());
+          return false;
+        }
         break;
       case DT_STRSZ: /* Ignored */
         debug_dyn("DT_STRSZ", dyn);
         break;
       case UNSUPPORTED_RELOC():
       case UNSUPPORTED_RELOC(SZ):
       case UNSUPPORTED_RELOC(ENT):
         LOG("%s: Unsupported relocations", GetPath());
@@ -642,17 +647,22 @@ CustomElf::InitDyn(const Phdr *pt_dyn)
           return false;
         }
         break;
       case DT_FLAGS:
         {
            Addr flags = dyn->d_un.d_val;
            /* Treat as a DT_TEXTREL tag */
            if (flags & DF_TEXTREL) {
-             has_text_relocs = true;
+             if (strcmp("libflashplayer.so", GetName()) == 0) {
+               has_text_relocs = true;
+             } else {
+               LOG("%s: Text relocations are not supported", GetPath());
+               return false;
+             }
            }
            /* we can treat this like having a DT_SYMBOLIC tag */
            flags &= ~DF_SYMBOLIC;
            if (flags)
              LOG("%s: Warning: unhandled flags #%" PRIxAddr" not handled",
                  GetPath(), flags);
         }
         break;