* link/z80/lkmain.c,
[fw/sdcc] / link / z80 / lkdata.c
index 18751708276224ca9f04a17b1c5b478fc92fb384..3d075b7db164473de756a68533245c2bb51c2ead 100644 (file)
@@ -11,7 +11,7 @@
 
 #include <stdio.h>
 #include <string.h>
-#include <alloc.h>
+//#include <alloc.h>
 #include "aslink.h"
 
 /*)Module      lkdata.c
@@ -38,6 +38,11 @@ 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    oflag;          /*      Output file type flag
                         */
 int    mflag;          /*      Map output flag
@@ -67,7 +72,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.
@@ -97,7 +102,7 @@ int  gcntr;          /*      LST file relocation active
 struct lfile   *filep; /*      The pointers (lfile *) filep,
                         *      (lfile *) cfp, and (FILE *) sfp
                         *      are used in conjunction with
-                        *      the routine getline() to read
+                        *      the routine lk_getline() to read
                         *      asmlnk commands from
                         *      (1) the standard input or
                         *      (2) or a command file
@@ -188,8 +193,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
@@ -222,8 +227,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
@@ -248,7 +253,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[NCPS];             Name
  *     };
  */
@@ -302,7 +307,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 */
@@ -321,9 +326,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
@@ -419,7 +424,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,