mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:57:45 +00:00
LibC+LibELF: Implement dladdr()
This implements the dladdr() function which lets the caller look up the symbol name, symbol address as well as library name and library base address for an arbitrary address.
This commit is contained in:
parent
f82aa87d14
commit
89a38b72b7
5 changed files with 73 additions and 0 deletions
|
@ -23,12 +23,17 @@ struct DlErrorMessage {
|
|||
String text;
|
||||
};
|
||||
|
||||
struct __Dl_info;
|
||||
typedef struct __Dl_info Dl_info;
|
||||
|
||||
typedef Result<void, DlErrorMessage> (*DlCloseFunction)(void*);
|
||||
typedef Result<void*, DlErrorMessage> (*DlOpenFunction)(const char*, int);
|
||||
typedef Result<void*, DlErrorMessage> (*DlSymFunction)(void*, const char*);
|
||||
typedef Result<void, DlErrorMessage> (*DlAddrFunction)(void*, Dl_info*);
|
||||
|
||||
extern "C" {
|
||||
extern DlCloseFunction __dlclose;
|
||||
extern DlOpenFunction __dlopen;
|
||||
extern DlSymFunction __dlsym;
|
||||
extern DlAddrFunction __dladdr;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue