Extend the object code format by adding a (currently empty) scope table.
Use the address size for import, export and debug symbols (object code change). More changes to support the --memory-model switch and address sizes. git-svn-id: svn://svn.cc65.org/cc65/trunk@2691 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 1998-2003 Ullrich von Bassewitz */
|
||||
/* R<>merstrasse 52 */
|
||||
/* R<>merstra<EFBFBD>e 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
/* */
|
||||
@@ -104,6 +104,8 @@ static void ObjReadHeader (FILE* Obj, ObjHeader* H, const char* Name)
|
||||
H->StrPoolSize = Read32 (Obj);
|
||||
H->AssertOffs = Read32 (Obj);
|
||||
H->AssertSize = Read32 (Obj);
|
||||
H->ScopeOffs = Read32 (Obj);
|
||||
H->ScopeSize = Read32 (Obj);
|
||||
}
|
||||
|
||||
|
||||
@@ -252,6 +254,24 @@ void ObjReadAssertions (FILE* F, unsigned long Pos, ObjData* O)
|
||||
|
||||
|
||||
|
||||
void ObjReadScopes (FILE* F, unsigned long Pos, ObjData* O)
|
||||
/* Read the scope table from a file at the given offset */
|
||||
{
|
||||
unsigned I;
|
||||
|
||||
/* Seek to the correct position */
|
||||
FileSetPos (F, Pos);
|
||||
|
||||
/* Read the data */
|
||||
O->ScopeCount = ReadVar (F);
|
||||
O->Scopes = xmalloc (O->ScopeCount * sizeof (O->Scopes[0]));
|
||||
for (I = 0; I < O->ScopeCount; ++I) {
|
||||
O->Scopes[I] = 0; /* ReadScope (F, O); ### not implemented */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ObjAdd (FILE* Obj, const char* Name)
|
||||
/* Add an object file to the module list */
|
||||
{
|
||||
@@ -288,6 +308,9 @@ void ObjAdd (FILE* Obj, const char* Name)
|
||||
/* Read the assertions from the object file */
|
||||
ObjReadAssertions (Obj, O->Header.AssertOffs, O);
|
||||
|
||||
/* Read the scope table from the object file */
|
||||
ObjReadScopes (Obj, O->Header.ScopeOffs, O);
|
||||
|
||||
/* Read the segment list from the object file. This must be last, since
|
||||
* the expressions stored in the code may reference segments or imported
|
||||
* symbols.
|
||||
|
||||
Reference in New Issue
Block a user