mirror of
https://github.com/cc65/cc65.git
synced 2025-01-11 11:30:13 +00:00
Moved a warning message, about misaligned segments, to a configuration function.
It used to be shown only if the segment was written into a binary file. Now, it's shown for all badly-aligned segments.
This commit is contained in:
parent
8b685763d4
commit
fac246c799
@ -169,18 +169,6 @@ static void BinWriteMem (BinDesc* D, MemoryArea* M)
|
|||||||
PrintNumVal ("Address", Addr);
|
PrintNumVal ("Address", Addr);
|
||||||
PrintNumVal ("FileOffs", (unsigned long) ftell (D->F));
|
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
|
/* 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
|
** this is not the run memory area but the load memory area (which
|
||||||
** means that both are different), we must apply load alignment.
|
** means that both are different), we must apply load alignment.
|
||||||
|
@ -1855,6 +1855,20 @@ unsigned CfgProcess (void)
|
|||||||
/* This is the run (and maybe load) memory area. Handle
|
/* This is the run (and maybe load) memory area. Handle
|
||||||
** alignment and explict start address and offset.
|
** 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) {
|
if (S->Flags & SF_ALIGN) {
|
||||||
/* Align the address */
|
/* Align the address */
|
||||||
unsigned long NewAddr = AlignAddr (Addr, S->RunAlignment);
|
unsigned long NewAddr = AlignAddr (Addr, S->RunAlignment);
|
||||||
@ -1865,8 +1879,8 @@ unsigned CfgProcess (void)
|
|||||||
*/
|
*/
|
||||||
if (M->FillLevel == 0 && NewAddr > Addr) {
|
if (M->FillLevel == 0 && NewAddr > Addr) {
|
||||||
CfgWarning (GetSourcePos (S->LI),
|
CfgWarning (GetSourcePos (S->LI),
|
||||||
"First segment in memory area `%s' does "
|
"The first segment in memory area `%s' "
|
||||||
"already need fill bytes for alignment",
|
"needs fill bytes for alignment.",
|
||||||
GetString (M->Name));
|
GetString (M->Name));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user