Mercurial > hg-old > index.cgi
comparison src/lwasm.h @ 86:033a328a10ae
Checkpoint: object target output
author | lost |
---|---|
date | Fri, 16 Jan 2009 05:33:40 +0000 |
parents | 918be0c02239 |
children | 6097cb1486f8 |
comparison
equal
deleted
inserted
replaced
85:918be0c02239 | 86:033a328a10ae |
---|---|
31 #define OUTPUT_RAW 1 // raw sequence of bytes | 31 #define OUTPUT_RAW 1 // raw sequence of bytes |
32 #define OUTPUT_OBJ 2 // proprietary object file format | 32 #define OUTPUT_OBJ 2 // proprietary object file format |
33 #define OUTPUT_RAWREL 3 // raw bytes where ORG causes a SEEK in the file | 33 #define OUTPUT_RAWREL 3 // raw bytes where ORG causes a SEEK in the file |
34 | 34 |
35 // structure for tracking sections | 35 // structure for tracking sections |
36 typedef struct section_reloc_list_s section_reloc_list_t; | |
37 struct section_reloc_list_s | |
38 { | |
39 int offset; // offset into section | |
40 lwasm_expr_stack_t *expr; // value definition | |
41 section_reloc_list_t *next; // next relocation | |
42 }; | |
43 | |
36 #define SECTION_BSS 1 // the section contains no actual code - just uninit vars | 44 #define SECTION_BSS 1 // the section contains no actual code - just uninit vars |
37 typedef struct sectiontab_s sectiontab_t; | 45 typedef struct sectiontab_s sectiontab_t; |
38 struct sectiontab_s | 46 struct sectiontab_s |
39 { | 47 { |
40 char *name; // name of the section | 48 char *name; // name of the section |
41 int offset; // current offset in the section | 49 int offset; // current offset in the section |
42 int flags; // section flags | 50 int flags; // section flags |
43 sectiontab_t *next; // next section | 51 sectiontab_t *next; // next section |
52 // the following are used during code output | |
44 unsigned char *obytes; // output bytes | 53 unsigned char *obytes; // output bytes |
45 int oblen; // how many bytes output so far? | 54 int oblen; // how many bytes output so far? |
46 int obsize; // how big is output buffer so far? | 55 int obsize; // how big is output buffer so far? |
56 section_reloc_list_t *rl; // relocation list | |
47 }; | 57 }; |
48 | 58 |
49 // structure for tracking macros | 59 // structure for tracking macros |
50 typedef struct macrotab_s macrotab_t; | 60 typedef struct macrotab_s macrotab_t; |
51 struct macrotab_s | 61 struct macrotab_s |