forked from blitz-research/blitz3d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlinker.h
35 lines (25 loc) · 779 Bytes
/
linker.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef LINKER_H
#define LINKER_H
class Module{
public:
virtual ~Module(){}
virtual void *link( Module *libs )=0;
virtual bool createExe( const char *exe_file,const char *dll_file )=0;
virtual int getPC()=0;
virtual void emit( int byte )=0;
virtual void emitw( int word )=0;
virtual void emitd( int dword )=0;
virtual void emitx( void *data,int sz )=0;
virtual bool addSymbol( const char *sym,int pc )=0;
virtual bool addReloc( const char *dest_sym,int pc,bool pcrel )=0;
virtual bool findSymbol( const char *sym,int *pc )=0;
};
class Linker{
public:
virtual int version();
virtual bool canCreateExe();
virtual Module *createModule();
virtual void deleteModule( Module *mod );
};
extern "C" _declspec(dllexport) Linker * _cdecl linkerGetLinker();
#endif