Userland: Fix wrong signature of dladdr
This function is supposed to take a `const void *addr` as first parameter, but we took a `void *addr`. https://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/baselib-dladdr-3.html
This commit is contained in:
parent
87e95ceb69
commit
36a26d7fa8
Notes:
sideshowbarker
2024-07-17 10:10:18 +09:00
Author: https://github.com/fdellwing Commit: https://github.com/SerenityOS/serenity/commit/36a26d7fa8 Pull-request: https://github.com/SerenityOS/serenity/pull/18620 Reviewed-by: https://github.com/gmta ✅ Reviewed-by: https://github.com/kleinesfilmroellchen ✅
4 changed files with 5 additions and 5 deletions
|
@ -30,7 +30,7 @@ typedef struct __Dl_info Dl_info;
|
|||
typedef Result<void, DlErrorMessage> (*DlCloseFunction)(void*);
|
||||
typedef Result<void*, DlErrorMessage> (*DlOpenFunction)(char const*, int);
|
||||
typedef Result<void*, DlErrorMessage> (*DlSymFunction)(void*, char const*);
|
||||
typedef Result<void, DlErrorMessage> (*DlAddrFunction)(void*, Dl_info*);
|
||||
typedef Result<void, DlErrorMessage> (*DlAddrFunction)(void const*, Dl_info*);
|
||||
|
||||
extern "C" {
|
||||
extern DlCloseFunction __dlclose;
|
||||
|
|
|
@ -72,7 +72,7 @@ void* dlsym(void* handle, char const* symbol_name)
|
|||
return result.value();
|
||||
}
|
||||
|
||||
int dladdr(void* addr, Dl_info* info)
|
||||
int dladdr(void const* addr, Dl_info* info)
|
||||
{
|
||||
auto result = __dladdr(addr, info);
|
||||
if (result.is_error()) {
|
||||
|
|
|
@ -27,6 +27,6 @@ int dlclose(void*);
|
|||
char* dlerror(void);
|
||||
void* dlopen(char const*, int);
|
||||
void* dlsym(void*, char const*);
|
||||
int dladdr(void*, Dl_info*);
|
||||
int dladdr(void const*, Dl_info*);
|
||||
|
||||
__END_DECLS
|
||||
|
|
|
@ -64,7 +64,7 @@ static DeprecatedString s_loader_pledge_promises;
|
|||
static Result<void, DlErrorMessage> __dlclose(void* handle);
|
||||
static Result<void*, DlErrorMessage> __dlopen(char const* filename, int flags);
|
||||
static Result<void*, DlErrorMessage> __dlsym(void* handle, char const* symbol_name);
|
||||
static Result<void, DlErrorMessage> __dladdr(void* addr, Dl_info* info);
|
||||
static Result<void, DlErrorMessage> __dladdr(void const* addr, Dl_info* info);
|
||||
|
||||
Optional<DynamicObject::SymbolLookupResult> DynamicLinker::lookup_global_symbol(StringView name)
|
||||
{
|
||||
|
@ -552,7 +552,7 @@ static Result<void*, DlErrorMessage> __dlsym(void* handle, char const* symbol_na
|
|||
return symbol.value().address.as_ptr();
|
||||
}
|
||||
|
||||
static Result<void, DlErrorMessage> __dladdr(void* addr, Dl_info* info)
|
||||
static Result<void, DlErrorMessage> __dladdr(void const* addr, Dl_info* info)
|
||||
{
|
||||
VirtualAddress user_addr { addr };
|
||||
pthread_mutex_lock(&s_loader_lock);
|
||||
|
|
Loading…
Add table
Reference in a new issue