* src/SDCCmain.c: removed various references to DEFAULT_PORT
* src/port.h: added flag needLinkerScript in port->linker
structure to inform whether to create a .lnk file or not,
* src/avr/main.c,
* src/ds390/main.c,
* src/hc08/main.c,
* src/mcs51/main.c,
* src/pic/main.c,
* src/pic16/main.c,
* src/xa51/main.c,
* src/z80/main.c: changed appropriately to configure
needLinkerScript flag
* src/pic/gen.c,
* src/pic16/gen.c (genAddrOf): fixed bug #863624
* src/pic/glue.c: added variable udata_section_name to
override default uninitialized data segment definition for
devices only with SHAREBANK memory (reported from Erik Epetrich)
* (pic14emitOverlay): modified to emit a commented overlay segment
directive when no overlay data exist
* (picglue): modified to emit uninitialized data segment
according to udata_section_name
* src/pic/main.c (_pic14_parseOptions): added command line
options --udata-section-name=[name] to override default
udata definition name
* modified _linkCmd and _asmCmd to include compiler passed
arguments via -W option
* src/pic16/main.c: added $l in _asmCmd, changed extension for
object file from '.rel' to '.o' in port->linker structure,
changed size of fptr from 2 to 3 in port structure
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3099
4a8a32a2-be11-0410-ad9d-
d568d2c75423
+2004-01-08 Vangelis Rokas <vrokas@otenet.gr>
+
+ * src/SDCCmain.c: removed various references to DEFAULT_PORT
+ * src/port.h: added flag needLinkerScript in port->linker
+ structure to inform whether to create a .lnk file or not,
+ * src/avr/main.c,
+ * src/ds390/main.c,
+ * src/hc08/main.c,
+ * src/mcs51/main.c,
+ * src/pic/main.c,
+ * src/pic16/main.c,
+ * src/xa51/main.c,
+ * src/z80/main.c: changed appropriately to configure
+ needLinkerScript flag
+ * src/pic/gen.c,
+ * src/pic16/gen.c (genAddrOf): fixed bug #863624
+ * src/pic/glue.c: added variable udata_section_name to
+ override default uninitialized data segment definition for
+ devices only with SHAREBANK memory (reported from Erik Epetrich)
+ * (pic14emitOverlay): modified to emit a commented overlay segment
+ directive when no overlay data exist
+ * (picglue): modified to emit uninitialized data segment
+ according to udata_section_name
+ * src/pic/main.c (_pic14_parseOptions): added command line
+ options --udata-section-name=[name] to override default
+ udata definition name
+ * modified _linkCmd and _asmCmd to include compiler passed
+ arguments via -W option
+ * src/pic16/main.c: added $l in _asmCmd, changed extension for
+ object file from '.rel' to '.o' in port->linker structure,
+ changed size of fptr from 2 to 3 in port structure
+
2004-01-07 Borut Razem <borut.razem@siol.net>
* support/scripts/sdcc.nsi: update PATH
}
/* Use the first in the list */
-#if defined(DEFAULT_PORT)
- /* VR - 13/5/2003 DEFAULT_PORT is defined in port.h */
- port = &DEFAULT_PORT;
-#else
port = _ports[0];
-#endif
-
}
/* search through the command line options for the processor */
fprintf (stderr,
"SDCC : ");
- for (i = 0; i < NUM_PORTS; i++) {
+ for (i = 0; i < NUM_PORTS; i++)
fprintf (stderr, "%s%s", i == 0 ? "" : "/", _ports[i]->target);
-#ifdef DEFAULT_PORT
- fprintf(stderr, "%s", (&DEFAULT_PORT == _ports[i])?"*":"");
-#endif
- }
fprintf (stderr, " " SDCC_VERSION_STR
#ifdef SDCC_SUB_VERSION_STR
int system_ret;
const char *s;
+
+ if(port->linker.needLinkerScript) {
/* first we need to create the <filename>.lnk file */
SNPRINTF (scratchFileName, sizeof(scratchFileName),
"%s.lnk", dstFileName);
fprintf (lnkfile, "\n-e\n");
fclose (lnkfile);
+ } /* if(port->linker.needLinkerScript) */
if (options.verbose)
printf ("sdcc: Calling linker...\n");
_linkCmd,
NULL,
NULL,
- ".rel"},
+ ".rel",
+ 1},
{
_defaultRules},
{
_linkCmd,
NULL,
NULL,
- ".rel"
+ ".rel",
+ 1
},
{
_defaultRules
_linkCmd,
NULL,
NULL,
- ".rel"
+ ".rel",
+ 1
},
{
_defaultRules
_linkCmd,
NULL,
NULL,
- ".rel"
+ ".rel",
+ 1
},
{
_defaultRules
offset = 0;
while (size--) {
+ /* fixing bug #863624, reported from (errolv) */
+ emitpcode(POC_MOVLW, popGetImmd(OP_SYMBOL(left)->rname, offset, 0, IS_FUNC(OP_SYM_TYPE(left))));
+ emitpcode(POC_MOVWF, popGet(AOP(result), offset));
+
+#if 0
emitpcode(POC_MOVLW, popGet(AOP(left),offset));
emitpcode(POC_MOVWF, popGet(AOP(result),offset));
+#endif
offset++;
}
void pCodeInitRegisters(void);
int getConfigWord(int address);
+char *udata_section_name="udata"; // FIXME Temporary fix to change udata section name -- VR
+
/*-----------------------------------------------------------------*/
/* aopLiteral - string from a literal value */
/*-----------------------------------------------------------------*/
{
set *ovrset;
- if (!elementsInSet (ovrSetSets))
- fprintf (afile, "\t%s\n", port->mem.overlay_name);
+/* if (!elementsInSet (ovrSetSets))*/
+
+ /* the hack below, fixes translates for devices which
+ * only have udata_shr memory */
+ fprintf (afile, "%s\t%s\n",
+ (elementsInSet(ovrSetSets)?"":";"),
+ port->mem.overlay_name);
/* for each of the sets in the overlay segment do */
for (ovrset = setFirstItem (ovrSetSets); ovrset;
copyFile (asmFile, sfr->oFile);
fprintf (asmFile, "%s", iComments2);
- fprintf (asmFile, "; udata\n");
+ fprintf (asmFile, "; %s\n", udata_section_name);
fprintf (asmFile, "%s", iComments2);
- fprintf (asmFile, "\tudata\n");
+ fprintf (asmFile, "\t%s\n", udata_section_name);
copyFile (asmFile, data->oFile);
/* Put all variables into a cblock */
return 1;
}
+extern char *udata_section_name;
+
static bool
_pic14_parseOptions (int *pargc, char **argv, int *i)
{
+ char buf[128];
+
/* TODO: allow port-specific command line options to specify
* segment names here.
*/
+
+ /* This is a temporary hack, to solve problems with some processors
+ * that do not have udata section. It will be changed when a more
+ * robust solution is figured out -- VR 27-11-2003 FIXME
+ */
+ strcpy(buf, "--udata-section-name");
+ if(!strncmp(buf, argv[ *i ], strlen(buf))) {
+ if(strlen(argv[ *i ]) <= strlen(buf)+1) {
+ fprintf(stderr, "WARNING: no `%s' entered\n", buf+2);
+ exit(-1);
+ } else {
+ udata_section_name = strdup( strchr(argv[*i], '=') + 1 );
+ }
+ return 1;
+ }
+
return FALSE;
}
*/
static const char *_linkCmd[] =
{
- "gplink", "", "\"$1.o\"", NULL
+ "gplink", "-o $2", "\"$1.o\"", "$l", NULL
};
static const char *_asmCmd[] =
{
- "gpasm", "-c", "\"$1.asm\"", NULL
+ "gpasm", "$l", "-c", "\"$1.asm\"", NULL
};
_linkCmd,
NULL,
NULL,
- ".o"
+ ".o",
+ 0
},
{
_defaultRules
*/
static const char *_asmCmd[] =
{
- "gpasm", "-c -I/usr/local/share/gputils/header", "\"$1.asm\"", NULL
+ "gpasm", "$l", "-c", "\"$1.asm\"", NULL
};
_linkCmd, /* linker command and arguments */
NULL, /* alternate macro based form */
NULL, /* no do_link function */
- ".rel" /* extension for object files */
+ ".o", /* extension for object files */
+ 0 /* no need for linker file */
},
{
_defaultRules
2, /* int */
4, /* long */
2, /* ptr */
- 2, /* fptr, this should be changed to 3 for far pointers (see Microchip) */
+ 3, /* fptr, far pointers (see Microchip) */
2, /* gptr */
1, /* bit */
4, /* float */
void (*do_link) (void);
/** Extension for object files (.rel, .obj, ...) */
const char *rel_ext;
+ /** 1 if port needs the .lnk file, 0 otherwise */
+ const int needLinkerScript;
}
linker;
_linkCmd,
NULL,
NULL,
- ".rel"
+ ".rel",
+ 1
},
{
_defaultRules
NULL,
LINKCMD,
NULL,
- ".o"
+ ".o",
+ 1
},
{
_gbz80_defaultRules