Added stub implementations for dl*() functions

This commit is contained in:
2022-02-27 17:03:15 +00:00
parent 6a364d0866
commit eb0c90369a
2 changed files with 44 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
#ifndef DLFCN_H_
#define DLFCN_H_
#define RTLD_LAZY 0
#define RTLD_NOW 1
#define RTLD_GLOBAL 2
#define RTLD_LOCAL 3
extern void *dlopen(const char *path, int mode);
extern void *dlsym(void *handle, const char *name);
extern int dlclose(void *handle);
extern char *dlerror(void);
#endif

View File

@@ -0,0 +1,30 @@
#include <magenta/types.h>
#include <stddef.h>
#include <dlfcn.h>
__attribute__((weak)) void *dyld_load_object(mx_handle_t handle, int mode) { return NULL; }
__attribute__((weak)) void *dyld_get_symbol(void *handle, const char *name) { return NULL; }
__attribute__((weak)) int dyld_close_object(void *handle) { return 0; }
__attribute__((weak)) char *dyld_get_error(void) { return NULL; }
void *dlopen(const char *path, int mode)
{
dyld_load_object(MX_NULL_HANDLE, 0);
return NULL;
}
void *dlsym(void *handle, const char *name)
{
return NULL;
}
int dlclose(void *handle)
{
return 0;
}
char *dlerror(void)
{
return NULL;
}