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

@@ -37,6 +37,7 @@
#include <errno.h>
/* common */
#include "mmodel.h"
#include "segnames.h"
#include "xmalloc.h"
@@ -488,6 +489,36 @@ static void WriteOneSeg (Segment* Seg)
void InitSegments (void)
/* Initialize segments */
{
/* Initialize segment sizes. The segment definitions do already contain
* the correct values for the default case (near), so we must only change
* things that should be different.
*/
switch (MemoryModel) {
case MMODEL_NEAR:
break;
case MMODEL_FAR:
CodeSegDef.AddrSize = ADDR_SIZE_FAR;
break;
case MMODEL_HUGE:
CodeSegDef.AddrSize = ADDR_SIZE_FAR;
DataSegDef.AddrSize = ADDR_SIZE_FAR;
BssSegDef.AddrSize = ADDR_SIZE_FAR;
RODataSegDef.AddrSize = ADDR_SIZE_FAR;
break;
default:
Internal ("Invalid memory model: %d", MemoryModel);
}
}
void WriteSegments (void)
/* Write the segment data to the object file */
{