зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1066760 - Add base address and fall back to system dladdr in __wrap_dladdr; r=froydnj
This commit is contained in:
Родитель
1cc43c5dbb
Коммит
f3c570c80b
|
@ -36,6 +36,7 @@ public:
|
||||||
virtual ~CustomElf();
|
virtual ~CustomElf();
|
||||||
virtual void *GetSymbolPtr(const char *symbol) const;
|
virtual void *GetSymbolPtr(const char *symbol) const;
|
||||||
virtual bool Contains(void *addr) const;
|
virtual bool Contains(void *addr) const;
|
||||||
|
virtual void *GetBase() const { return GetPtr(0); }
|
||||||
|
|
||||||
#ifdef __ARM_EABI__
|
#ifdef __ARM_EABI__
|
||||||
virtual const void *FindExidx(int *pcount) const;
|
virtual const void *FindExidx(int *pcount) const;
|
||||||
|
|
|
@ -90,9 +90,11 @@ int
|
||||||
__wrap_dladdr(void *addr, Dl_info *info)
|
__wrap_dladdr(void *addr, Dl_info *info)
|
||||||
{
|
{
|
||||||
RefPtr<LibHandle> handle = ElfLoader::Singleton.GetHandleByPtr(addr);
|
RefPtr<LibHandle> handle = ElfLoader::Singleton.GetHandleByPtr(addr);
|
||||||
if (!handle)
|
if (!handle) {
|
||||||
return 0;
|
return dladdr(addr, info);
|
||||||
|
}
|
||||||
info->dli_fname = handle->GetPath();
|
info->dli_fname = handle->GetPath();
|
||||||
|
info->dli_fbase = handle->GetBase();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -117,6 +117,11 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual bool Contains(void *addr) const = 0;
|
virtual bool Contains(void *addr) const = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the base address of the loaded library.
|
||||||
|
*/
|
||||||
|
virtual void *GetBase() const = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the file name of the library without the containing directory.
|
* Returns the file name of the library without the containing directory.
|
||||||
*/
|
*/
|
||||||
|
@ -267,6 +272,7 @@ public:
|
||||||
virtual ~SystemElf();
|
virtual ~SystemElf();
|
||||||
virtual void *GetSymbolPtr(const char *symbol) const;
|
virtual void *GetSymbolPtr(const char *symbol) const;
|
||||||
virtual bool Contains(void *addr) const { return false; /* UNIMPLEMENTED */ }
|
virtual bool Contains(void *addr) const { return false; /* UNIMPLEMENTED */ }
|
||||||
|
virtual void *GetBase() const { return nullptr; /* UNIMPLEMENTED */ }
|
||||||
|
|
||||||
#ifdef __ARM_EABI__
|
#ifdef __ARM_EABI__
|
||||||
virtual const void *FindExidx(int *pcount) const;
|
virtual const void *FindExidx(int *pcount) const;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче