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:
cuz
2003-11-28 22:12:14 +00:00
parent e3eea961c2
commit 8f9a21ae3f
35 changed files with 589 additions and 254 deletions

View File

@@ -6,10 +6,10 @@
/* */
/* */
/* */
/* (C) 1998 Ullrich von Bassewitz */
/* Wacholderweg 14 */
/* D-70597 Stuttgart */
/* EMail: uz@musoftware.de */
/* (C) 1998-2003 Ullrich von Bassewitz */
/* R<>merstra<72>e 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
@@ -37,6 +37,10 @@
#include <stdlib.h>
#include <stdarg.h>
/* common */
#include "cmdline.h"
/* ar65 */
#include "error.h"
@@ -52,7 +56,7 @@ void Warning (const char* Format, ...)
{
va_list ap;
va_start (ap, Format);
fprintf (stderr, "Warning: ");
fprintf (stderr, "%s: Warning: ", ProgName);
vfprintf (stderr, Format, ap);
putc ('\n', stderr);
va_end (ap);
@@ -65,7 +69,7 @@ void Error (const char* Format, ...)
{
va_list ap;
va_start (ap, Format);
fprintf (stderr, "Error: ");
fprintf (stderr, "%s: Error: ", ProgName);
vfprintf (stderr, Format, ap);
putc ('\n', stderr);
va_end (ap);
@@ -79,7 +83,7 @@ void Internal (const char* Format, ...)
{
va_list ap;
va_start (ap, Format);
fprintf (stderr, "Internal error: ");
fprintf (stderr, "%s: Internal error: ", ProgName);
vfprintf (stderr, Format, ap);
putc ('\n', stderr);
va_end (ap);

View File

@@ -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 */
/* */
@@ -53,7 +53,7 @@
/* A hash table entry */
typedef struct HashEntry HashEntry;
typedef struct HashEntry HashEntry;
struct HashEntry {
HashEntry* Next; /* Next in list */
unsigned Module; /* Module index */

View File

@@ -6,10 +6,10 @@
/* */
/* */
/* */
/* (C) 1998-2000 Ullrich von Bassewitz */
/* Wacholderweg 14 */
/* D-70597 Stuttgart */
/* EMail: uz@musoftware.de */
/* (C) 1998-2003 Ullrich von Bassewitz */
/* R<EFBFBD>merstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */

View File

@@ -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 */
/* */
@@ -408,20 +408,20 @@ static void LibCheckExports (ObjData* O)
Print (stdout, 1, "Module `%s' (%u exports):\n", O->Name, Count);
while (Count--) {
unsigned char Tag;
const char* Name;
/* Get the export tag */
Tag = *Exports++;
/* Get the export tag and skip the address size */
unsigned char Type = *Exports++;
++Exports;
/* condes decls may follow */
Exports += GET_EXP_CONDES_COUNT (Tag);
Exports += GET_EXP_CONDES_COUNT (Type);
/* Next thing is index of name of symbol */
Name = GetObjString (O, GetVar (&Exports));
/* Skip value of symbol */
if (Tag & EXP_EXPR) {
if (Type & EXP_EXPR) {
/* Expression tree */
SkipExpr (&Exports);
} else {

View File

@@ -6,10 +6,10 @@
/* */
/* */
/* */
/* (C) 1998-2001 Ullrich von Bassewitz */
/* Wacholderweg 14 */
/* D-70597 Stuttgart */
/* EMail: uz@musoftware.de */
/* (C) 1998-2003 Ullrich von Bassewitz */
/* R<>merstra<72>e 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
@@ -122,7 +122,7 @@ int main (int argc, char* argv [])
case 'V':
fprintf (stderr,
"ar65 V%u.%u.%u - (C) Copyright 1998-2001 Ullrich von Bassewitz\n",
"ar65 V%u.%u.%u - (C) Copyright 1998-2003 Ullrich von Bassewitz\n",
VER_MAJOR, VER_MINOR, VER_PATCH);
break;

View File

@@ -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 */
/* */
@@ -113,6 +113,8 @@ 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);
}
@@ -140,7 +142,9 @@ void ObjWriteHeader (FILE* Obj, ObjHeader* H)
Write32 (Obj, H->StrPoolOffs);
Write32 (Obj, H->StrPoolSize);
Write32 (Obj, H->AssertOffs);
Write32 (Obj, H->AssertSize);
Write32 (Obj, H->AssertSize);
Write32 (Obj, H->ScopeOffs);
Write32 (Obj, H->ScopeSize);
}
@@ -225,6 +229,8 @@ void ObjAdd (const char* Name)
H.LineInfoOffs = LibCopyTo (Obj, H.LineInfoSize) - O->Start;
fseek (Obj, H.AssertOffs, SEEK_SET);
H.AssertOffs = LibCopyTo (Obj, H.AssertSize) - O->Start;
fseek (Obj, H.ScopeOffs, SEEK_SET);
H.ScopeOffs = LibCopyTo (Obj, H.ScopeSize) - O->Start;
/* Calculate the amount of data written */
O->Size = ftell (NewLib) - O->Start;