* src/SDCCmain.c (linkEdit): use TARGET_Z80_LIKE,
output PSEG location if --xram-loc or --xstack-loc was used
* as/link/mcs51/lkarea.c (lnksect2): set segment address afterwards
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4561
4a8a32a2-be11-0410-ad9d-
d568d2c75423
-2007-01-06 Maarten Brock <sourceforge.brock AT dse.nl>
+2007-01-07 Maarten Brock <sourceforge.brock AT dse.nl>
+
+ * src/port.h: added TARGET_Z80_LIKE macro
+ * src/SDCCmain.c (linkEdit): use TARGET_Z80_LIKE,
+ output PSEG location if --xram-loc or --xstack-loc was used
+ * as/link/mcs51/lkarea.c (lnksect2): set segment address afterwards
+
+2007-01-07 Maarten Brock <sourceforge.brock AT dse.nl>
* as/as_gbz80.dsp, as/z80/as_gbz80.dsp,
* as/as_z80.dsp, as/z80/as_z80.dsp,
* as/as_gbz80.dsp, as/z80/as_gbz80.dsp,
* as/as_z80.dsp, as/z80/as_z80.dsp,
+ tap->a_addr = tap->a_axp->a_addr;
if ((tap->a_flag&A_PAG) && (size > 256))
{
if ((tap->a_flag&A_PAG) && (size > 256))
{
{ 0, OPTION_XRAM_LOC, NULL, "<nnnn> External Ram start location" },
{ 0, OPTION_XRAM_SIZE, NULL, "<nnnn> External Ram size" },
{ 0, OPTION_IRAM_SIZE, NULL, "<nnnn> Internal Ram size" },
{ 0, OPTION_XRAM_LOC, NULL, "<nnnn> External Ram start location" },
{ 0, OPTION_XRAM_SIZE, NULL, "<nnnn> External Ram size" },
{ 0, OPTION_IRAM_SIZE, NULL, "<nnnn> Internal Ram size" },
- { 0, OPTION_XSTACK_LOC, NULL, "<nnnn> External Ram start location" },
+ { 0, OPTION_XSTACK_LOC, NULL, "<nnnn> External Stack start location" },
{ 0, OPTION_CODE_LOC, NULL, "<nnnn> Code Segment Location" },
{ 0, OPTION_CODE_SIZE, NULL, "<nnnn> Code Segment size" },
{ 0, OPTION_STACK_LOC, NULL, "<nnnn> Stack pointer initial value" },
{ 0, OPTION_CODE_LOC, NULL, "<nnnn> Code Segment Location" },
{ 0, OPTION_CODE_SIZE, NULL, "<nnnn> Code Segment size" },
{ 0, OPTION_STACK_LOC, NULL, "<nnnn> Stack pointer initial value" },
/* is the dot in the filename, not in the path? */
(strrchr (buffer, DIR_SEPARATOR_CHAR) < strrchr (buffer, '.')))
{
/* is the dot in the filename, not in the path? */
(strrchr (buffer, DIR_SEPARATOR_CHAR) < strrchr (buffer, '.')))
{
- *strrchr (buffer, '.') = '\0';
+ *strrchr (buffer, '.') = '\0';
}
/* get rid of any path information
}
/* get rid of any path information
*(fext - 1) != DIR_SEPARATOR_CHAR &&
*(fext - 1) != ':')
{
*(fext - 1) != DIR_SEPARATOR_CHAR &&
*(fext - 1) != ':')
{
}
#else
/* do this by going backwards till we
}
#else
/* do this by going backwards till we
- if (TARGET_IS_Z80 || TARGET_IS_GBZ80)
{
fprintf (lnkfile, "--\n-m\n-j\n-x\n-%c %s\n",
out_fmt, dstFileName);
{
fprintf (lnkfile, "--\n-m\n-j\n-x\n-%c %s\n",
out_fmt, dstFileName);
fprintf (lnkfile, "-Y\n");
}
fprintf (lnkfile, "-Y\n");
}
- if (!(TARGET_IS_Z80 || TARGET_IS_GBZ80)) /*Not for the z80, gbz80*/
+ if (!(TARGET_Z80_LIKE)) /*Not for the z80, gbz80*/
{
/* if iram size specified */
if (options.iram_size)
{
/* if iram size specified */
if (options.iram_size)
fprintf (lnkfile,"-b %s = 0x%04x\n", c, L); \
if (segName) { Safe_free(segName); }
fprintf (lnkfile,"-b %s = 0x%04x\n", c, L); \
if (segName) { Safe_free(segName); }
- if (!(TARGET_IS_Z80 || TARGET_IS_GBZ80)) /*Not for the z80, gbz80*/
+ if (!(TARGET_Z80_LIKE)) /*Not for the z80, gbz80*/
{
/* code segment start */
{
/* code segment start */
WRITE_SEG_LOC (XDATA_NAME, options.xdata_loc);
}
WRITE_SEG_LOC (XDATA_NAME, options.xdata_loc);
}
+ /* pdata/xstack segment start. If zero, the linker
+ chooses the best place for them */
+ if (options.xstack_loc)
+ {
+ WRITE_SEG_LOC (PDATA_NAME, options.xstack_loc);
+ }
+
/* indirect data */
if (IDATA_NAME)
{
/* indirect data */
if (IDATA_NAME)
{
/* standard library path */
if (!options.nostdlib)
{
/* standard library path */
if (!options.nostdlib)
{
- if (!(TARGET_IS_Z80 || TARGET_IS_GBZ80 || TARGET_IS_HC08)) /*Not for the z80, gbz80*/
+ if (!(TARGET_Z80_LIKE || TARGET_IS_HC08)) /*Not for the z80, gbz80*/
{
switch (options.model)
{
{
switch (options.model)
{
{
fprintf (lnkfile, "-l mcs51\n");
}
{
fprintf (lnkfile, "-l mcs51\n");
}
- if (!(TARGET_IS_Z80 || TARGET_IS_GBZ80
- || TARGET_IS_HC08)) /*Not for the z80, gbz80*/
+ if (!(TARGET_Z80_LIKE || TARGET_IS_HC08)) /*Not for the z80, gbz80*/
{ /*Why the z80 port is not using the standard libraries?*/
fprintf (lnkfile, "-l %s\n", STD_LIB);
fprintf (lnkfile, "-l %s\n", STD_INT_LIB);
{ /*Why the z80 port is not using the standard libraries?*/
fprintf (lnkfile, "-l %s\n", STD_LIB);
fprintf (lnkfile, "-l %s\n", STD_INT_LIB);
/*For the z80 and gbz80 ports, try to find where crt0.o is...
It is very important for this file to be first on the linking proccess
so the areas are set in the correct order, expecially _GSINIT*/
/*For the z80 and gbz80 ports, try to find where crt0.o is...
It is very important for this file to be first on the linking proccess
so the areas are set in the correct order, expecially _GSINIT*/
- if ((TARGET_IS_Z80 || TARGET_IS_GBZ80) &&
- !options.no_std_crt0) /*For the z80, gbz80*/
+ if ((TARGET_Z80_LIKE) && !options.no_std_crt0) /*For the z80, gbz80*/
{
char crt0path[PATH_MAX];
FILE * crt0fp;
{
char crt0path[PATH_MAX];
FILE * crt0fp;