From e7ac95f6dd864d4d2d8d08ba624708c63597f010 Mon Sep 17 00:00:00 2001 From: johanknol Date: Thu, 7 Feb 2002 18:55:43 +0000 Subject: [PATCH] xa51, work in progress git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1904 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- as/xa51/xa_link.c | 37 +++++++++++++++++++++-------------- device/examples/xa51/Makefile | 2 +- src/SDCCmain.c | 3 ++- src/xa51/main.c | 8 +++----- 4 files changed, 28 insertions(+), 22 deletions(-) diff --git a/as/xa51/xa_link.c b/as/xa51/xa_link.c index 64d89e5d..b8901565 100644 --- a/as/xa51/xa_link.c +++ b/as/xa51/xa_link.c @@ -1,3 +1,7 @@ +/* WORK IN PROGRESS: do not watch this if you don't have the legal + age in your country to watch this. +*/ + /* This is a cheap hack. The xa51 has a couple of ways to scramble relocation info into it's opcode that the standard linker can't handle. @@ -6,24 +10,23 @@ The only things that are handled now are: - "SDCCXA rel, version %f" must be the first line + "SDCCXA rel, version %f" must be the first line, sort of MAGIC word "H %d areas %d global symbols" defines the # of areas and globals "S [Ref000 | DefXXXX]" Def's are supposed to be defined in their own area/segment "A size %d flags %d" switch to another segment. this can happen - multiple times and should be equal. flags is ignored - "T xx xx bb bb ..." where x is the address within the current segment + multiple times and should be equal. flags is ignored for now + "T xx xx bb bb ..." where xx xx is the address within the current segment and bb are the bytes - "R xx " the relocation tag. xx is the offset within the + "R xx " the relocation info. xx is the offset within the previous "T .." line. could be something like REL_FF, REL_FFFF, - ABS_F0FF. and symbol is the previous defined symbol it refers to - - Thats all for now. + ABS_F0FF. symbol is the (previous) defined symbol it refers to */ #include #include #include +#include #include "xa_version.h" @@ -48,7 +51,7 @@ void baseName(char *name, char*base) { last=strlen(name); } - printf ("baseName: %s %d %d\n", name, first, last); + fprintf (stderr, "baseName: %s %d %d\n", name, first, last); // fill the base with the baseName for (i=first; iassembler.plain_opts */ static const char *_asmCmd[] = @@ -221,9 +219,9 @@ PORT xa51_port = NULL /* no do_assemble function */ }, { - NULL, //_linkCmd, + _linkCmd, + NULL, NULL, - xa_link, ".rel" }, { -- 2.30.2