From: Evgeny Vrublevsky Date: Wed, 17 Oct 2018 19:05:21 +0000 (+0300) Subject: Don't output a warning about alignment when section address is defined by START or... X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d4088f9eee390dc9c88a780eb90d96b661be5e22;p=cc65 Don't output a warning about alignment when section address is defined by START or OFFSET and fits required alignment requirements --- diff --git a/src/ld65/config.c b/src/ld65/config.c index 73eee1caa..1d3e810f6 100644 --- a/src/ld65/config.c +++ b/src/ld65/config.c @@ -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. */