diff options
author | Quentin Carbonneaux <quentin@c9x.me> | 2022-01-31 22:03:18 +0100 |
---|---|---|
committer | Quentin Carbonneaux <quentin@c9x.me> | 2022-02-02 21:09:37 +0100 |
commit | 2ca6fb25a238842418019a3f9ee8d1beb1327f7e (patch) | |
tree | be083fc02dc8c1175f454b0adfd23d662f96476f /all.h | |
parent | 20ee522ce8c4d1ffdd7b6e24a4f7af587c35404a (diff) | |
download | roux-2ca6fb25a238842418019a3f9ee8d1beb1327f7e.tar.gz |
shared linkage logic for func/data
Diffstat (limited to 'all.h')
-rw-r--r-- | all.h | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/all.h b/all.h index 98b77dd..942c52d 100644 --- a/all.h +++ b/all.h @@ -28,6 +28,7 @@ typedef struct Fn Fn; typedef struct Typ Typ; typedef struct Field Field; typedef struct Dat Dat; +typedef struct Lnk Lnk; typedef struct Target Target; enum { @@ -327,6 +328,13 @@ struct Addr { /* amd64 addressing */ int scale; }; +struct Lnk { + char export; + char align; + char *sec; + char *secf; +}; + struct Fn { Blk *start; Tmp *tmp; @@ -341,10 +349,10 @@ struct Fn { Blk **rpo; bits reg; int slot; - char export; char vararg; char dynalloc; char name[NString]; + Lnk lnk; }; struct Typ { @@ -373,8 +381,6 @@ struct Dat { enum { DStart, DEnd, - DName, - DAlign, DB, DH, DW, @@ -387,13 +393,16 @@ struct Dat { float flts; char *str; struct { - char *nam; + char *name; int64_t off; } ref; + struct { + char *name; + Lnk *lnk; + } start; } u; char isref; char isstr; - char export; }; /* main.c */ @@ -516,6 +525,7 @@ void rega(Fn *); /* gas.c */ extern char *gasloc; extern char *gassym; +void gasemitlnk(char *, Lnk *, char *, FILE *); void gasemitdat(Dat *, FILE *); int gasstash(void *, int); void gasemitfin(FILE *); |