]> git.sur5r.net Git - cc65/commitdiff
Don't output a warning about alignment when section address is defined by START or...
authorEvgeny Vrublevsky <me@veg.by>
Wed, 17 Oct 2018 19:05:21 +0000 (22:05 +0300)
committerOliver Schmidt <ol.sc@web.de>
Thu, 18 Oct 2018 13:37:14 +0000 (15:37 +0200)
src/ld65/config.c

index 73eee1caac57255b715d353eb401b2a578a6950e..1d3e810f6b70f4c3c4bc4614f8eb6ba000cd516a 100644 (file)
@@ -1881,9 +1881,14 @@ unsigned CfgProcess (void)
                 */
 
                 /* Check if the alignment for the segment from the linker
-                ** config. is a multiple for that of the segment.
+                ** config is a multiple for that of the segment.
+                ** If START or OFFSET is provided instead of ALIGN, check
+                ** if its address fits alignment requirements.
                 */
-                if ((S->RunAlignment % S->Seg->Alignment) != 0) {
+                unsigned long AlignedBy = (S->Flags & SF_START) ? S->Addr
+                    : (S->Flags & SF_OFFSET) ? (S->Addr + M->Start)
+                    : S->RunAlignment;
+                if ((AlignedBy % S->Seg->Alignment) != 0) {
                     /* Segment requires another alignment than configured
                     ** in the linker.
                     */