diff src/lwlink.h @ 298:96a35a4245f3

reading files implemented
author lost
date Wed, 21 Jan 2009 03:15:49 +0000
parents c52ad3135bd3
children 460d96987670
line wrap: on
line diff
--- a/src/lwlink.h	Sun Jan 18 04:53:57 2009 +0000
+++ b/src/lwlink.h	Wed Jan 21 03:15:49 2009 +0000
@@ -24,17 +24,55 @@
 #ifndef __lwlink_h_seen__
 #define __lwlink_h_seen__
 
+#include "expr.h"
+
 #define OUTPUT_DECB		0	// DECB multirecord format
 #define OUTPUT_RAW		1	// raw sequence of bytes
 
+typedef struct symtab_s symtab_t;
+struct symtab_s
+{
+	unsigned char *sym;		// symbol name
+	int offset;				// local offset
+	int realval;			// resolved value
+	symtab_t *next;			// next symbol
+};
+
+typedef struct reloc_s reloc_t;
+struct reloc_s
+{
+	int offset;				// where in the section
+	lw_expr_stack_t *expr;	// the expression to calculate it
+	reloc_t *next;			// ptr to next relocation
+};
+
+#define SECTION_BSS		1
+typedef struct
+{
+	unsigned char *name;	// name of the section
+	int flags;				// section flags
+	int codesize;			// size of the code
+	unsigned char *code;	// pointer to the code
+	int loadaddress;		// the actual load address of the section
+	
+	symtab_t *localsyms;	// local symbol table
+	symtab_t *exportedsyms;	// exported symbols table
+	
+	reloc_t *incompletes;	// table of incomplete references
+} section_t;
 
 typedef struct
 {
 	char *filename;
 	unsigned char *filedata;
 	long filesize;
+	section_t *sections;
+	int nsections;
+	
 } fileinfo_t;
 
+
+
 #ifndef __lwlink_c_seen__
 
 extern int debug_level;