From: uz Date: Tue, 16 Aug 2011 11:50:27 +0000 (+0000) Subject: Handle the new symbol flags correctly. Changed - among other things - the X-Git-Tag: V2.13.3~282 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=11be5d626162c18516418553d5a78186e1c1435c;p=cc65 Handle the new symbol flags correctly. Changed - among other things - the data types of members in the management structures. git-svn-id: svn://svn.cc65.org/cc65/trunk@5180 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/ld65/dbgsyms.c b/src/ld65/dbgsyms.c index 090520adf..445167818 100644 --- a/src/ld65/dbgsyms.c +++ b/src/ld65/dbgsyms.c @@ -72,7 +72,7 @@ static DbgSym* DbgSymPool[256]; -static DbgSym* NewDbgSym (unsigned char Type, unsigned char AddrSize, ObjData* O) +static DbgSym* NewDbgSym (unsigned Type, unsigned char AddrSize, ObjData* O) /* Create a new DbgSym and return it */ { /* Allocate memory */ @@ -80,7 +80,6 @@ static DbgSym* NewDbgSym (unsigned char Type, unsigned char AddrSize, ObjData* O /* Initialize the fields */ D->Next = 0; - D->Flags = 0; D->Obj = O; D->LineInfos = EmptyCollection; D->Expr = 0; @@ -204,10 +203,10 @@ long GetDbgSymVal (const DbgSym* D) } - + void PrintDbgSyms (FILE* F) /* Print the debug symbols in a debug file */ -{ +{ unsigned I, J; for (I = 0; I < CollCount (&ObjDataList); ++I) { diff --git a/src/ld65/dbgsyms.h b/src/ld65/dbgsyms.h index ad84fd9be..209d78f4a 100644 --- a/src/ld65/dbgsyms.h +++ b/src/ld65/dbgsyms.h @@ -62,15 +62,14 @@ struct Scope; typedef struct DbgSym DbgSym; struct DbgSym { DbgSym* Next; /* Pool linear list link */ - unsigned Flags; /* Generic flags */ ObjData* Obj; /* Object file that exports the name */ Collection LineInfos; /* Line infos of definition */ ExprNode* Expr; /* Expression (0 if not def'd) */ - unsigned long Size; /* Symbol size if any */ + unsigned Size; /* Symbol size if any */ unsigned OwnerId; /* Id of parent/owner */ unsigned Name; /* Name */ - unsigned char Type; /* Type of symbol */ - unsigned char AddrSize; /* Address size of symbol */ + unsigned short Type; /* Type of symbol */ + unsigned short AddrSize; /* Address size of symbol */ }; diff --git a/src/ld65/exports.c b/src/ld65/exports.c index 13ec49d8b..9be4e22fb 100644 --- a/src/ld65/exports.c +++ b/src/ld65/exports.c @@ -92,7 +92,7 @@ static Export** ExpPool = 0; /* Exports array */ -static Export* NewExport (unsigned char Type, unsigned char AddrSize, +static Export* NewExport (unsigned Type, unsigned char AddrSize, unsigned Name, ObjData* Obj); /* Create a new export and initialize it */ @@ -289,7 +289,7 @@ const LineInfo* GetImportPos (const Import* I) -static Export* NewExport (unsigned char Type, unsigned char AddrSize, +static Export* NewExport (unsigned Type, unsigned char AddrSize, unsigned Name, ObjData* Obj) /* Create a new export and initialize it */ { @@ -306,7 +306,7 @@ static Export* NewExport (unsigned char Type, unsigned char AddrSize, E->Expr = 0; E->Size = 0; E->LineInfos = EmptyCollection; - E->Type = Type; + E->Type = Type | SYM_EXPORT; E->AddrSize = AddrSize; memset (E->ConDes, 0, sizeof (E->ConDes)); @@ -486,7 +486,7 @@ Export* CreateConstExport (unsigned Name, long Value) /* Create an export for a literal date */ { /* Create a new export */ - Export* E = NewExport (SYM_CONST | SYM_EQUATE, ADDR_SIZE_ABS, Name, 0); + Export* E = NewExport (SYM_CONST|SYM_EQUATE, ADDR_SIZE_ABS, Name, 0); /* Assign the value */ E->Expr = LiteralExpr (Value, 0); @@ -504,7 +504,7 @@ Export* CreateExprExport (unsigned Name, ExprNode* Expr, unsigned char AddrSize) /* Create an export for an expression */ { /* Create a new export */ - Export* E = NewExport (SYM_EXPR | SYM_EQUATE, AddrSize, Name, 0); + Export* E = NewExport (SYM_EXPR|SYM_EQUATE, AddrSize, Name, 0); /* Assign the value expression */ E->Expr = Expr; diff --git a/src/ld65/exports.h b/src/ld65/exports.h index 003757278..535e7b24c 100644 --- a/src/ld65/exports.h +++ b/src/ld65/exports.h @@ -67,8 +67,8 @@ struct Import { Collection LineInfos; /* Line info of reference */ struct Export* Exp; /* Matching export for this import */ unsigned Name; /* Name if not in table */ - unsigned char Flags; /* Generic flags */ - unsigned char AddrSize; /* Address size of import */ + unsigned short Flags; /* Generic flags */ + unsigned short AddrSize; /* Address size of import */ }; @@ -83,10 +83,10 @@ struct Export { unsigned ImpCount; /* How many imports for this symbol? */ Import* ImpList; /* List of imports for this symbol */ ExprNode* Expr; /* Expression (0 if not def'd) */ - unsigned long Size; /* Size of the symbol if any */ + unsigned Size; /* Size of the symbol if any */ Collection LineInfos; /* Line info of definition */ - unsigned char Type; /* Type of export */ - unsigned char AddrSize; /* Address size of export */ + unsigned short Type; /* Type of export */ + unsigned short AddrSize; /* Address size of export */ unsigned char ConDes[CD_TYPE_COUNT]; /* Constructor/destructor decls */ };