]> git.sur5r.net Git - cc65/blobdiff - src/ld65/segments.h
Added classification macros for file types from struct dirent.
[cc65] / src / ld65 / segments.h
index 32d7ab114643113dd41b34998ac13bb8d4be25c5..9810c0f574174a9166b37bffd6265cd22038cfcb 100644 (file)
@@ -6,7 +6,7 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 1998-2011, Ullrich von Bassewitz                                      */
+/* (C) 1998-2012, Ullrich von Bassewitz                                      */
 /*                Roemerstrasse 52                                           */
 /*                D-70794 Filderstadt                                        */
 /* EMail:         uz@cc65.org                                                */
@@ -41,6 +41,7 @@
 #include <stdio.h>
 
 /* common */
+#include "coll.h"
 #include "exprdefs.h"
 
 
 
 
 
+/* Forwards */
+struct MemoryArea;
+
 /* Segment structure */
 typedef struct Segment Segment;
 struct Segment {
     unsigned            Name;           /* Name index of the segment */
     unsigned            Id;             /* Segment id for debug info */
-    Segment*           Next;           /* Hash list */
-    struct Section*    SecRoot;        /* Section list */
-    struct Section*    SecLast;        /* Pointer to last section */
+    Segment*           Next;           /* Hash list */
+    unsigned            Flags;          /* Segment flags */
+    Collection          Sections;       /* Sections in this segment */
+    struct MemoryArea*  MemArea;        /* Run memory area once placed */
     unsigned long      PC;             /* PC were this segment is located */
     unsigned long      Size;           /* Size of data so far */
-    struct ObjData*    AlignObj;       /* Module that requested the alignment */
     const char*         OutputName;     /* Name of output file or NULL */
     unsigned long       OutputOffs;     /* Offset in output file */
-    unsigned char      Align;          /* Alignment needed */
+    unsigned long       Alignment;      /* Alignment needed */
     unsigned char      FillVal;        /* Value to use for fill bytes */
     unsigned char      AddrSize;       /* Address size of segment */
     unsigned char       ReadOnly;       /* True for readonly segments (config) */
-    unsigned char       Relocatable;    /* True if the segment is relocatable */
-    unsigned char       Placed;         /* Did we place this segment already? */
     unsigned char              Dumped;         /* Did we dump this segment? */
 };
 
@@ -86,7 +88,7 @@ struct Section {
     unsigned long      Offs;           /* Offset into the segment */
     unsigned long      Size;           /* Size of the section */
     unsigned long       Fill;           /* Fill bytes for alignment */
-    unsigned char      Align;          /* Alignment */
+    unsigned long       Alignment;      /* Alignment */
     unsigned char      AddrSize;       /* Address size of segment */
 };
 
@@ -120,7 +122,7 @@ Segment* GetSegment (unsigned Name, unsigned char AddrSize, const char* ObjName)
  * message and may be NULL if the segment is linker generated.
  */
 
-Section* NewSection (Segment* Seg, unsigned char Align, unsigned char AddrSize);
+Section* NewSection (Segment* Seg, unsigned long Alignment, unsigned char AddrSize);
 /* Create a new section for the given segment */
 
 Section* ReadSection (FILE* F, struct ObjData* O);