]> git.sur5r.net Git - cc65/commitdiff
Moved a warning message, about misaligned segments, to a configuration function. 280/head
authorGreg King <gregdk@users.sf.net>
Tue, 29 Mar 2016 09:40:12 +0000 (05:40 -0400)
committerGreg King <gregdk@users.sf.net>
Tue, 29 Mar 2016 09:40:12 +0000 (05:40 -0400)
It used to be shown only if the segment was written into a binary file.  Now, it's shown for all badly-aligned segments.

src/ld65/bin.c
src/ld65/config.c

index ada4f1e3c55a1c5fed2e35d8e5740dc07f3127be..c3efd9cd1654db24f51e4e46c3cdfb77aa868337 100644 (file)
@@ -169,18 +169,6 @@ static void BinWriteMem (BinDesc* D, MemoryArea* M)
         PrintNumVal  ("Address", Addr);
         PrintNumVal  ("FileOffs", (unsigned long) ftell (D->F));
 
-        /* Check if the alignment for the segment from the linker config is
-        ** a multiple for that of the segment.
-        */
-        if ((S->RunAlignment % S->Seg->Alignment) != 0) {
-            /* Segment requires another alignment than configured
-            ** in the linker.
-            */
-            Warning ("Segment `%s' is not aligned properly. Resulting "
-                     "executable may not be functional.",
-                     GetString (S->Name));
-        }
-
         /* If this is the run memory area, we must apply run alignment. If
         ** this is not the run memory area but the load memory area (which
         ** means that both are different), we must apply load alignment.
index 8e7a049c7df5fa57abbd59fb6c8752480e683580..5959067b221d570d7bea928c2e76993ae1759174 100644 (file)
@@ -1855,6 +1855,20 @@ unsigned CfgProcess (void)
                 /* This is the run (and maybe load) memory area. Handle
                 ** alignment and explict start address and offset.
                 */
+
+                /* Check if the alignment for the segment from the linker
+                ** config. is a multiple for that of the segment.
+                */
+                if ((S->RunAlignment % S->Seg->Alignment) != 0) {
+                    /* Segment requires another alignment than configured
+                    ** in the linker.
+                    */
+                    CfgWarning (GetSourcePos (S->LI),
+                                "Segment `%s' isn't aligned properly; the"
+                                " resulting executable might not be functional.",
+                                GetString (S->Name));
+                }
+
                 if (S->Flags & SF_ALIGN) {
                     /* Align the address */
                     unsigned long NewAddr = AlignAddr (Addr, S->RunAlignment);
@@ -1865,8 +1879,8 @@ unsigned CfgProcess (void)
                     */
                     if (M->FillLevel == 0 && NewAddr > Addr) {
                         CfgWarning (GetSourcePos (S->LI),
-                                    "First segment in memory area `%s' does "
-                                    "already need fill bytes for alignment",
+                                    "The first segment in memory area `%s' "
+                                    "needs fill bytes for alignment.",
                                     GetString (M->Name));
                     }