mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
Bug 1066760 - Add base address and fall back to system dladdr in __wrap_dladdr; r=froydnj
This commit is contained in:
parent
1cc43c5dbb
commit
f3c570c80b
@ -36,6 +36,7 @@ public:
|
||||
virtual ~CustomElf();
|
||||
virtual void *GetSymbolPtr(const char *symbol) const;
|
||||
virtual bool Contains(void *addr) const;
|
||||
virtual void *GetBase() const { return GetPtr(0); }
|
||||
|
||||
#ifdef __ARM_EABI__
|
||||
virtual const void *FindExidx(int *pcount) const;
|
||||
|
@ -90,9 +90,11 @@ int
|
||||
__wrap_dladdr(void *addr, Dl_info *info)
|
||||
{
|
||||
RefPtr<LibHandle> handle = ElfLoader::Singleton.GetHandleByPtr(addr);
|
||||
if (!handle)
|
||||
return 0;
|
||||
if (!handle) {
|
||||
return dladdr(addr, info);
|
||||
}
|
||||
info->dli_fname = handle->GetPath();
|
||||
info->dli_fbase = handle->GetBase();
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -117,6 +117,11 @@ public:
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
@ -267,6 +272,7 @@ public:
|
||||
virtual ~SystemElf();
|
||||
virtual void *GetSymbolPtr(const char *symbol) const;
|
||||
virtual bool Contains(void *addr) const { return false; /* UNIMPLEMENTED */ }
|
||||
virtual void *GetBase() const { return nullptr; /* UNIMPLEMENTED */ }
|
||||
|
||||
#ifdef __ARM_EABI__
|
||||
virtual const void *FindExidx(int *pcount) const;
|
||||
|
Loading…
Reference in New Issue
Block a user