mirror of
https://github.com/wiiu-env/wut.git
synced 2024-12-05 03:24:17 +01:00
Save the end of fstub section in rpl header.
This commit is contained in:
parent
2f06f61f89
commit
0dba889081
@ -1,20 +1,29 @@
|
||||
#include "config.h"
|
||||
|
||||
typedef struct {
|
||||
const char* name;
|
||||
const void* fstub;
|
||||
} __attribute__((__packed__)) rpl_header;
|
||||
|
||||
static const void* fstub[0] __attribute__((section(".data.rplFuncStubs")));
|
||||
static const const char name[] __attribute__((section(".rodata.rplNames"))) = LIBRARY_NAME;
|
||||
|
||||
static rpl_header header __attribute__((section(".lib.rplLibs"))) = {
|
||||
name,
|
||||
fstub,
|
||||
};
|
||||
// Get the start of the stubs
|
||||
static const void* fstubBegin[0] __attribute__((section(".data.rplFuncStubs")));
|
||||
|
||||
#define EXPORT(name) \
|
||||
extern void* name; \
|
||||
const void* name##_stub __attribute__((section(".data.rplFuncStubs"))) = &name; \
|
||||
|
||||
#include "exports.h"
|
||||
|
||||
// Get the end of the stubs
|
||||
static const void* fstubEnd[0] __attribute__((section(".data.rplFuncStubs")));
|
||||
|
||||
// Create a header with the name and stub begin/end in
|
||||
typedef struct
|
||||
{
|
||||
const char* name;
|
||||
const void* fstubBegin;
|
||||
const void* fstubEnd;
|
||||
} __attribute__((__packed__)) rpl_header;
|
||||
|
||||
static const const char name[] __attribute__((section(".rodata.rplNames"))) = LIBRARY_NAME;
|
||||
|
||||
static rpl_header header __attribute__((section(".lib.rplLibs"))) = {
|
||||
name,
|
||||
fstubBegin,
|
||||
fstubEnd,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user