]> Shamusworld >> Repos - rmac/blobdiff - symbol.h
ELF support for RMAC.
[rmac] / symbol.h
index 9ce6b175e9b9235624ff7a7c4e63f7709daa2c4b..9c5c26a82e08e15feef7b35a8ef64985c655e537 100644 (file)
--- a/symbol.h
+++ b/symbol.h
@@ -1,9 +1,9 @@
 //
 // RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System
 // SYMBOL.H - Symbol Handling
-// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends
+// Copyright (C) 199x Landon Dyer, 2017 Reboot and Friends
 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
-// Source Utilised with the Kind Permission of Landon Dyer
+// Source utilised with the kind permission of Landon Dyer
 //
 
 #ifndef __SYMBOL_H__
@@ -15,7 +15,7 @@
 struct LineList
 {
        struct LineList * next;
-       char * line;
+       uint8_t * line;
 };
 
 // Symbols
@@ -25,27 +25,32 @@ SYM
        SYM * snext;                                    // * -> Next symbol on hash-chain
        SYM * sorder;                                   // * -> Next sym in order of reference
        SYM * sdecl;                                    // * -> Next sym in order of declaration
-       uint8_t stype;                                  // Symbol type 
+       uint8_t stype;                                  // Symbol type
        uint16_t sattr;                                 // Attribute bits
        uint32_t sattre;                                // Extended attribute bits
        uint16_t senv;                                  // Enviroment number
        uint32_t svalue;                                // Symbol value
-       char * sname;                                   // * -> Symbol's print-name
+       uint8_t * sname;                                // * -> Symbol's print-name
        struct LineList * lineList;             // * -> Macro's linked list of lines
        struct LineList * last;                 // * -> end of macro linked list
+       uint32_t uid;                                   // Symbol's unique ID
 };
 
-// Globals, externals etc
+// Globals, externals, etc.
 extern int curenv;
-extern char subttl[];
+extern uint8_t subttl[];
+extern uint32_t firstglobal;// Index of the fist global symbol in an ELF object.
 
-// Prototypes
-SYM * lookup(char *, int, int);
+// Exported functions
+SYM * lookup(uint8_t *, int, int);
 void InitSymbolTable(void);
-SYM * NewSymbol(char *, int, int);
-void sym_decl(SYM *);
-int syg_fix(void);
+SYM * NewSymbol(uint8_t *, int, int);
+void AddToSymbolDeclarationList(SYM *);
+void ForceUndefinedSymbolsGlobal(void);
 int symtable(void);
-int sy_assign(char *, char *(*)());
+uint32_t sy_assign(uint8_t *, uint8_t *(*)());
+uint32_t sy_assign_ELF(uint8_t *, uint8_t *(*)());
+uint8_t * GetSymbolNameByUID(uint32_t);
 
 #endif // __SYMBOL_H__
+