shithub: scc

ref: 8f241ba283b03cd4dffcd8bc1753bb3f500949f5
dir: /src/cmd/ld/ld.h/

View raw version
struct obj;
struct objsym;

typedef struct objlst Objlst;
typedef struct symbol Symbol;
typedef struct section Section;

enum {
	NOINSTALL,
	INSTALL,
};

enum {
	OUTLIB,
	INLIB,
};

struct section {
	char *name;
	unsigned long base;
	unsigned long long size;
	unsigned flags;
	int type;
	FILE *fp;
	Section *next;
};

struct objlst {
	struct obj *obj;
	struct objlst *next;
};

struct symbol {
	char *name;
	struct obj *obj;
	struct objsym *def;
	unsigned long long size, value;
	struct symbol *next, *prev;
	struct symbol *hash;
};

/* passes */
extern void pass1(int argc, char *argv[]);
extern void pass2(int argc, char *argv[]);
extern void pass3(int argc, char *argv[]);

/* main.c */
extern char *errstr(void);
extern void error(char *fmt, ...);

/* symbol.c */
extern Symbol *lookup(char *name, int install);
extern Symbol *define(struct objsym *osym, struct obj *obj);
extern int newsym(struct objsym *osym, struct obj *obj);
extern int moreundef(void);
extern void listundef(void);
extern int defasym(struct obj *obj);
extern int debugsym(void);

/* globals */
extern char *filename, *membname;
extern unsigned long textsiz, datasiz, bsssiz;
extern unsigned long textbase, database, bssbase;
extern int sflag;
extern int xflag;
extern int Xflag;
extern int rflag;
extern int dflag;
extern int gflag;
extern char *Dflag;
extern Objlst *objhead, *objlast;