]> git.sur5r.net Git - cc65/blobdiff - src/ld65/fragment.c
Ignore module.inc
[cc65] / src / ld65 / fragment.c
index 22b45f8e4a1c176fc07f66f3ab8163ef2c23eb7c..0051a26d5c0501b3c8acc7a1466a303a7efc541f 100644 (file)
@@ -6,10 +6,10 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 1998-2000 Ullrich von Bassewitz                                       */
+/* (C) 1998-2001 Ullrich von Bassewitz                                       */
 /*               Wacholderweg 14                                             */
 /*               D-70597 Stuttgart                                           */
-/* EMail:        uz@musoftware.de                                            */
+/* EMail:        uz@cc65.org                                                 */
 /*                                                                           */
 /*                                                                           */
 /* This software is provided 'as-is', without any expressed or implied       */
@@ -31,7 +31,7 @@
 /*                                                                           */
 /*****************************************************************************/
 
-                   
+
 
 /* common */
 #include "xmalloc.h"
@@ -59,9 +59,11 @@ Fragment* NewFragment (unsigned char Type, unsigned long Size, Section* S)
     F->Obj  = 0;
     F->Size = Size;
     F->Expr = 0;
+    InitFilePos (&F->Pos);
+    F->LI   = 0;
     F->Type = Type;
 
-    /* Insert the code fragment into the segment */
+    /* Insert the code fragment into the section */
     if (S->FragRoot == 0) {
        /* First fragment */
        S->FragRoot = F;
@@ -69,8 +71,13 @@ Fragment* NewFragment (unsigned char Type, unsigned long Size, Section* S)
        S->FragLast->Next = F;
     }
     S->FragLast = F;
+
+    /* Increment the size of the section by the size of the fragment */
     S->Size += Size;
 
+    /* Increment the size of the segment that contains the section */
+    S->Seg->Size += Size;
+
     /* Return the new fragment */
     return F;
 }