X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=blobdiff_plain;f=symbol.h;h=fadb8a4238d203d1f02d2701425c06c4c9f10a38;hp=e183b432d5a50ad861726d1c94af38d2574893a1;hb=HEAD;hpb=062214e62031c26d372edc2e68473ebb64f6a506 diff --git a/symbol.h b/symbol.h index e183b43..4a84345 100644 --- a/symbol.h +++ b/symbol.h @@ -1,9 +1,9 @@ // -// RMAC - Reboot's Macro Assembler for the Atari Jaguar Console System +// RMAC - Renamed Macro Assembler for all Atari computers // SYMBOL.H - Symbol Handling -// Copyright (C) 199x Landon Dyer, 2011 Reboot and Friends +// Copyright (C) 199x Landon Dyer, 2011-2022 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__ @@ -12,42 +12,57 @@ #include // Line lists -struct LineList +#define LLIST struct _llist +LLIST { - struct LineList * next; - char * line; + LLIST * next; + uint8_t * line; + int lineno; }; // Symbols #define SYM struct _sym 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 - 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 - struct LineList * lineList; // * -> Macro's linked list of lines - struct LineList * last; // * -> end of macro linked list - uint32_t uid; // Symbol's unique ID + 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 + uint16_t sattr; // Attribute bits + uint32_t sattre; // Extended attribute bits + uint16_t senv; // Enviroment number + uint64_t svalue; // Symbol value (now 64-bit) + uint8_t * sname; // * -> Symbol's print-name + LLIST * lineList; // * -> Macro's linked list of lines + LLIST * last; // * -> end of macro linked list + uint16_t cfileno; // File the macro is defined in + uint32_t uid; // Symbol's unique ID + uint8_t st_type; // stabs debug symbol's "type" field + uint8_t st_other; // stabs debug symbol's "other" field + uint16_t st_desc; // stabs debug symbol's "description" field }; -// Globals, externals etc +// Exported variables extern int curenv; -extern char 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 AddToSymbolOrderList(SYM *); -int syg_fix(void); +SYM * NewSymbol(const uint8_t *, int, int); +void AddToSymbolDeclarationList(SYM *); +void ForceUndefinedSymbolsGlobal(void); int symtable(void); -int sy_assign(char *, char *(*)()); -char * GetSymbolNameByUID(uint32_t); +uint32_t AssignSymbolNos(uint8_t *, uint8_t *(*)()); +uint32_t AssignSymbolNosELF(uint8_t *, uint8_t *(*)()); +void DumpLODSymbols(void); +uint8_t * GetSymbolNameByUID(uint32_t); +SYM * NewDebugSymbol(const uint8_t *, uint8_t, uint8_t, uint16_t); +void GenMainFileSym(const char *); +void GenLineNoSym(void); + +// Helper to avoid unnecessary branches: +#define GENLINENOSYM() if (dsym_flag) GenLineNoSym() #endif // __SYMBOL_H__ +