Write spans out in a separate object file section. This allows to merge

duplicate spans in an object file and more extensions to come.


git-svn-id: svn://svn.cc65.org/cc65/trunk@5250 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2011-08-21 19:08:23 +00:00
parent 37ac033370
commit 358ccf236e
18 changed files with 396 additions and 111 deletions

View File

@@ -6,10 +6,10 @@
/* */
/* */
/* */
/* (C) 1998-2003 Ullrich von Bassewitz */
/* R<EFBFBD>merstra<EFBFBD>e 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* (C) 1998-2011, Ullrich von Bassewitz */
/* Roemerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
@@ -86,6 +86,8 @@ static ObjHeader Header = {
0, /* 32: Size of assertion table */
0, /* 32: Offset into scope table */
0, /* 32: Size of scope table */
0, /* 32: Offset into span table */
0, /* 32: Size of span table */
};
@@ -142,6 +144,8 @@ static void ObjWriteHeader (void)
ObjWrite32 (Header.AssertSize);
ObjWrite32 (Header.ScopeOffs);
ObjWrite32 (Header.ScopeSize);
ObjWrite32 (Header.SpanOffs);
ObjWrite32 (Header.SpanSize);
}
@@ -304,7 +308,7 @@ void ObjWriteBuf (const StrBuf* S)
* advance).
*/
ObjWriteVar (SB_GetLen (S));
ObjWriteData (SB_GetConstBuf (S), SB_GetLen (S));
ObjWriteData (SB_GetConstBuf (S), SB_GetLen (S));
}
@@ -495,3 +499,19 @@ void ObjEndScopes (void)
void ObjStartSpans (void)
/* Mark the start of the span table */
{
Header.SpanOffs = ftell (F);
}
void ObjEndSpans (void)
/* Mark the end of the span table */
{
Header.SpanSize = ftell (F) - Header.SpanOffs;
}