Changed the object file and library format. There is now an additional

string table in the object file that (currently) holds all identifiers
from the import, export and debug info sections. The plan is to put all
strings into this table, so we have them in a central place and don't
waste memory. Apart from that, the indices are unique, so comparing strings
should be a lot easier than before (as soon as the programs take advantage
of this fact, which is currently not the case).


git-svn-id: svn://svn.cc65.org/cc65/trunk@2169 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2003-05-25 17:57:50 +00:00
parent 487ded2ce2
commit 76e67e2f97
41 changed files with 804 additions and 401 deletions

View File

@@ -6,9 +6,9 @@
/* */
/* */
/* */
/* (C) 1998-2001 Ullrich von Bassewitz */
/* Wacholderweg 14 */
/* D-70597 Stuttgart */
/* (C) 1998-2003 Ullrich von Bassewitz */
/* R<EFBFBD>merstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* */
/* */
@@ -63,9 +63,25 @@ static FILE* F = 0;
/* Header structure */
static ObjHeader Header = {
OBJ_MAGIC,
OBJ_VERSION,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
OBJ_MAGIC, /* 32: Magic number */
OBJ_VERSION, /* 16: Version number */
0, /* 16: flags */
0, /* 32: Offset to option table */
0, /* 32: Size of options */
0, /* 32: Offset to file table */
0, /* 32: Size of files */
0, /* 32: Offset to segment table */
0, /* 32: Size of segment table */
0, /* 32: Offset to import list */
0, /* 32: Size of import list */
0, /* 32: Offset to export list */
0, /* 32: Size of export list */
0, /* 32: Offset to list of debug symbols */
0, /* 32: Size of debug symbols */
0, /* 32: Offset to list of line infos */
0, /* 32: Size of line infos */
0, /* 32: Offset to string pool */
0 /* 32: Size of string pool */
};
@@ -116,6 +132,8 @@ static void ObjWriteHeader (void)
ObjWrite32 (Header.DbgSymSize);
ObjWrite32 (Header.LineInfoOffs);
ObjWrite32 (Header.LineInfoSize);
ObjWrite32 (Header.StrPoolOffs);
ObjWrite32 (Header.StrPoolSize);
}
@@ -386,3 +404,19 @@ void ObjEndLineInfos (void)
void ObjStartStrPool (void)
/* Mark the start of the string pool section */
{
Header.StrPoolOffs = ftell (F);
}
void ObjEndStrPool (void)
/* Mark the end of the string pool section */
{
Header.StrPoolSize = ftell (F) - Header.StrPoolOffs;
}