FEX/ThunkLibs/libfex_malloc_loader/Guest.cpp
Paulo Matos 2b4ec88dae Whole-tree reformat
This follows discussions from #3413.
Followup commits add clang-format file, script and blame ignore lists.
2024-04-12 16:26:02 +02:00

16 lines
419 B
C++

/*
$info$
tags: thunklibs|fex_malloc_loader
desc: Delays malloc symbol replacement until it is safe to run constructors
$end_info$
*/
#include <stdio.h>
#include <dlfcn.h>
extern "C" {
__attribute__((constructor)) static void loadlib() {
fprintf(stderr, "Time to load mallocs\n");
dlopen("/mnt/Work/Work/work/FEXNew/Build/Guest/libfex_malloc-guest.so", RTLD_GLOBAL | RTLD_NOW | RTLD_NODELETE | RTLD_DEEPBIND);
}
}