-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlink.h
64 lines (47 loc) · 1011 Bytes
/
link.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef link_h
#define link_h
#include <string>
#include <cstdint>
extern bool verbose;
extern bool compress;
extern bool express;
extern std::string save_file;
struct symbol {
std::string name;
std::string file;
uint32_t value = 0;
unsigned id = 0;
unsigned segment = 0;
unsigned count = 0;
bool absolute = false;
bool defined = false;
bool exd = false;
};
/*
a = assembler
l = linker
c = command file
a l c
EQU y n n
= n n y
GEQ y y y
KBD y y y
POS n y n
LEN n y n
EXT n n y << imports from linker to command
*/
enum {
LBL_EQU = (1 << 0),
LBL_GEQ = (1 << 0) | (1 << 1) | (1 << 2),
LBL_KBD = (1 << 0) | (1 << 1) | (1 << 2),
LBL_D = (1 << 0) | (1 << 1) | (1 << 2),
LBL_EQ = (1 << 2),
LBL_POS = (1 << 1),
LBL_LEN = (1 << 1),
LBL_EXT = (1 << 2)
};
void process_script(const char *argv);
void process_files(int argc, char **argv);
symbol *find_symbol(const std::string &name, bool insert = true);
void define(std::string name, uint32_t value, int type);
#endif