2015-12-27 03:10:38 +01:00
|
|
|
#include "config.h"
|
|
|
|
|
2015-12-27 03:58:21 +01:00
|
|
|
// 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
|
|
|
|
{
|
2015-12-27 03:10:38 +01:00
|
|
|
const char* name;
|
2015-12-27 03:58:21 +01:00
|
|
|
const void* fstubBegin;
|
|
|
|
const void* fstubEnd;
|
2015-12-27 03:10:38 +01:00
|
|
|
} __attribute__((__packed__)) rpl_header;
|
|
|
|
|
|
|
|
static const const char name[] __attribute__((section(".rodata.rplNames"))) = LIBRARY_NAME;
|
|
|
|
|
|
|
|
static rpl_header header __attribute__((section(".lib.rplLibs"))) = {
|
|
|
|
name,
|
2015-12-27 03:58:21 +01:00
|
|
|
fstubBegin,
|
|
|
|
fstubEnd,
|
2015-12-27 03:10:38 +01:00
|
|
|
};
|