* link/z80/lkmain.c (afile),
[fw/sdcc] / as / mcs51 / lkdata.c
index 87a51e7e3bbb4872b73be8de50da617e57da6c76..660c22af26a284cdd322057504dfa1f612aee010 100644 (file)
@@ -16,7 +16,6 @@
 
 #include <stdio.h>
 #include <string.h>
-#include <alloc.h>
 #include "aslink.h"
 
 /*)Module      lkdata.c
@@ -43,12 +42,23 @@ char        *rp;            /*      pointer into the LST file
 char   rb[NINPUT];     /*      LST file text line being
                         *      address relocated
                         */
+
+char sdccopt[NINPUT]="";
+char sdccopt_module[NINPUT]="";
+char curr_module[NINPUT]="";
+
 int     dflag;          /*      Debug information output flag
                         */
 int    oflag;          /*      Output file type flag
                         */
 int    mflag;          /*      Map output flag
                         */
+int    sflag;          /*      JCF: Memory usage output flag
+                        */
+int    packflag=0;     /*      JCF: Pack internal memory flag
+                        */
+int    stacksize=0;    /*      JCF: Stack size
+                        */
 int    aflag;          /*      Overlapping area warning flag
                         */
 int    jflag;          /*      NoICE output flag
@@ -59,6 +69,8 @@ int   pflag;          /*      print linker command file flag
                         */
 int    uflag;          /*      Listing relocation flag
                         */
+int    rflag;          /*      Extended linear address record flag.
+                        */
 int    radix;          /*      current number conversion radix:
                         *      2 (binary), 8 (octal), 10 (decimal),
                         *      16 (hexadecimal)
@@ -74,7 +86,7 @@ int   pass;           /*      linker pass number
 int    rtcnt;          /*      count of elements in the
                         *      rtval[] and rtflg[] arrays
                         */
-addr_t rtval[NTXT];    /*      data associated with relocation
+Addr_T rtval[NTXT];    /*      data associated with relocation
                         */
 int    rtflg[NTXT];    /*      indicates if rtval[] value is
                         *      to be sent to the output file.
@@ -88,7 +100,11 @@ int gline;          /*      LST file relocation active
 int    gcntr;          /*      LST file relocation active
                         *      counter
                         */
-addr_t iram_size;      /*      internal ram size
+Addr_T iram_size;      /*      internal ram size
+                        */
+long   xram_size=-1;   /*      external ram size
+                        */
+long   code_size=-1;   /*      code size
                         */
 
 /*
@@ -202,8 +218,8 @@ struct      head    *hp;    /*      Pointer to the current
  *     {
  *             struct  area    *a_ap;          Area link
  *             struct  areax   *a_axp;         Area extension link
- *             addr_t  a_addr;                 Beginning address of area
- *             addr_t  a_size;                 Total size of the area
+ *             Addr_T  a_addr;                 Beginning address of area
+ *             Addr_T  a_size;                 Total size of the area
  *             char    a_type;                 Area subtype
  *             char    a_flag;                 Flag byte
  *             char    a_id[NCPS];             Name
@@ -236,8 +252,8 @@ struct      area    *ap;    /*      Pointer to the current
  *             struct  areax   *a_axp;         Area extension link
  *             struct  area    *a_bap;         Base area link
  *             struct  head    *a_bhp;         Base header link
- *             addr_t  a_addr;                 Beginning address of section
- *             addr_t  a_size;                 Size of the area in section
+ *             Addr_T  a_addr;                 Beginning address of section
+ *             Addr_T  a_size;                 Size of the area in section
  *     };
  */
 struct areax   *axp;   /*      Pointer to the current
@@ -262,7 +278,7 @@ struct      areax   *axp;   /*      Pointer to the current
  *             struct  areax   *s_axp;         Symbol area link
  *             char    s_type;                 Symbol subtype
  *             char    s_flag;                 Flag byte
- *             addr_t  s_addr;                 Address
+ *             Addr_T  s_addr;                 Address
  *             char    *s_id;                  Name (JLH)
  *     };
  */
@@ -316,7 +332,7 @@ struct      globl   *gsp;   /*      Pointer to the current
  *     {
  *             struct  area  *s_area;  Paged Area link
  *             struct  areax *s_areax; Paged Area Extension Link
- *             addr_t  s_addr;         Page address offset
+ *             Addr_T  s_addr;         Page address offset
  *     };
  */
 struct sdp     sdp;    /* Base Page Structure */
@@ -335,9 +351,9 @@ struct      sdp     sdp;    /* Base Page Structure */
  *     {
  *             int     aindex;         Linking area
  *             int     mode;           Relocation mode
- *             addr_t  rtbase;         Base address in section
+ *             Addr_T  rtbase;         Base address in section
  *             int     rindex;         Area/Symbol reloaction index
- *             addr_t  rval;           Area/Symbol offset value
+ *             Addr_T  rval;           Area/Symbol offset value
  *     };
  */
 struct rerr    rerr;   /*      Structure containing the
@@ -433,7 +449,7 @@ struct      lbfile  *lbfhead;       /*      pointer to the first
  *     array of character types, one per
  *     ASCII character
  */
-char   ctype[128] = {
+unsigned char  ctype[128] = {
 /*NUL*/        ILL,    ILL,    ILL,    ILL,    ILL,    ILL,    ILL,    ILL,
 /*BS*/ ILL,    SPACE,  ILL,    ILL,    SPACE,  ILL,    ILL,    ILL,
 /*DLE*/        ILL,    ILL,    ILL,    ILL,    ILL,    ILL,    ILL,    ILL,