scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | README | LICENSE

ld.h (1363B)


      1 struct obj;
      2 struct objsym;
      3 
      4 typedef struct objlst Objlst;
      5 typedef struct symbol Symbol;
      6 typedef struct section Section;
      7 
      8 enum {
      9 	NOINSTALL,
     10 	INSTALL,
     11 };
     12 
     13 enum {
     14 	OUTLIB,
     15 	INLIB,
     16 };
     17 
     18 struct section {
     19 	char *name;
     20 	unsigned long base;
     21 	unsigned long long size;
     22 	unsigned flags;
     23 	int type;
     24 	FILE *fp;
     25 	Section *next;
     26 };
     27 
     28 struct objlst {
     29 	struct obj *obj;
     30 	struct objlst *next;
     31 };
     32 
     33 struct symbol {
     34 	char *name;
     35 	struct obj *obj;
     36 	struct objsym *def;
     37 	unsigned long long size, value;
     38 	struct symbol *next, *prev;
     39 	struct symbol *hash;
     40 };
     41 
     42 /* passes */
     43 extern void pass1(int argc, char *argv[]);
     44 extern void pass2(int argc, char *argv[]);
     45 extern void pass3(int argc, char *argv[]);
     46 
     47 /* main.c */
     48 extern char *errstr(void);
     49 extern void error(char *fmt, ...);
     50 
     51 /* symbol.c */
     52 extern Symbol *lookup(char *name, int install);
     53 extern Symbol *define(struct objsym *osym, struct obj *obj);
     54 extern int newsym(struct objsym *osym, struct obj *obj);
     55 extern int moreundef(void);
     56 extern void listundef(void);
     57 extern int defasym(struct obj *obj);
     58 extern int debugsym(void);
     59 
     60 /* globals */
     61 extern char *filename, *membname;
     62 extern unsigned long textsiz, datasiz, bsssiz;
     63 extern unsigned long textbase, database, bssbase;
     64 extern int sflag;
     65 extern int xflag;
     66 extern int Xflag;
     67 extern int rflag;
     68 extern int dflag;
     69 extern int gflag;
     70 extern char *Dflag;
     71 extern Objlst *objhead, *objlast;