From c39fcc8944e9539ed7345222f0579869df94e626 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Thu, 16 Oct 2014 09:19:45 +0900 Subject: [PATCH] Bug 1078837 part 1 - Move CustomElf::mappable to BaseElf. r=nfroyd --- mozglue/linker/BaseElf.h | 10 ++++++++-- mozglue/linker/CustomElf.h | 6 +----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/mozglue/linker/BaseElf.h b/mozglue/linker/BaseElf.h index 2c9164e92e7f..6ed2f91e8279 100644 --- a/mozglue/linker/BaseElf.h +++ b/mozglue/linker/BaseElf.h @@ -33,8 +33,11 @@ public: */ const Elf::Sym *GetSymbol(const char *symbol, unsigned long hash) const; - BaseElf(const char *path) - : LibHandle(path) { } + BaseElf(const char *path, Mappable *mappable = nullptr) + : LibHandle(path) + , mappable(mappable) + { + } protected: /** @@ -75,6 +78,9 @@ public: return reinterpret_cast(base + offset); } + /* Appropriated Mappable */ + mozilla::RefPtr mappable; + /* Base address where the library is loaded */ MappedPtr base; diff --git a/mozglue/linker/CustomElf.h b/mozglue/linker/CustomElf.h index 3ce13bb26e93..d727b0b7e1d0 100644 --- a/mozglue/linker/CustomElf.h +++ b/mozglue/linker/CustomElf.h @@ -66,9 +66,8 @@ private: * Private constructor */ CustomElf(Mappable *mappable, const char *path) - : BaseElf(path) + : BaseElf(path, mappable) , link_map() - , mappable(mappable) , init(0) , fini(0) , initialized(false) @@ -136,9 +135,6 @@ private: return CallFunction(GetPtr(addr)); } - /* Appropriated Mappable */ - mozilla::RefPtr mappable; - /* List of dependent libraries */ std::vector > dependencies;