From 81d8ff07e94f4fcd84e801e3ed1cf0a06c8d2f6b Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Sat, 25 Jan 2014 07:59:14 +0900 Subject: [PATCH] Bug 956398 - Only support text relocations for libflashplayer.so. r=nfroyd --- mozglue/linker/CustomElf.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/mozglue/linker/CustomElf.cpp b/mozglue/linker/CustomElf.cpp index efd1a576552d..dc09114d2e4b 100644 --- a/mozglue/linker/CustomElf.cpp +++ b/mozglue/linker/CustomElf.cpp @@ -576,7 +576,12 @@ CustomElf::InitDyn(const Phdr *pt_dyn) } 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); @@ -647,7 +652,12 @@ CustomElf::InitDyn(const Phdr *pt_dyn) 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;