mirror of
https://github.com/cc65/cc65.git
synced 2024-11-19 06:31:31 +00:00
Fixed an error: The amount of fill bytes for a section was declared as an
unsigned char, so larger values got truncated making alignments larger than $100 unreliable. git-svn-id: svn://svn.cc65.org/cc65/trunk@5042 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
c17816fafd
commit
c65292b78d
@ -181,7 +181,7 @@ Section* NewSection (Segment* Seg, unsigned char Align, unsigned char AddrSize)
|
||||
|
||||
/* Calculate the alignment bytes needed for the section */
|
||||
V = (0x01UL << S->Align) - 1;
|
||||
S->Fill = (unsigned char) (((Seg->Size + V) & ~V) - Seg->Size);
|
||||
S->Fill = (((Seg->Size + V) & ~V) - Seg->Size);
|
||||
|
||||
/* Adjust the segment size and set the section offset */
|
||||
Seg->Size += S->Fill;
|
||||
@ -475,7 +475,7 @@ void SegWrite (const char* TgtName, FILE* Tgt, Segment* S, SegWriteFunc F, void*
|
||||
Print (stdout, 2, " Section from \"%s\"\n", GetObjFileName (Sec->Obj));
|
||||
|
||||
/* If we have fill bytes, write them now */
|
||||
Print (stdout, 2, " Filling 0x%x bytes with 0x%02x\n",
|
||||
Print (stdout, 2, " Filling 0x%lx bytes with 0x%02x\n",
|
||||
Sec->Fill, S->FillVal);
|
||||
WriteMult (Tgt, S->FillVal, Sec->Fill);
|
||||
Offs += Sec->Fill;
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 1998-2010, Ullrich von Bassewitz */
|
||||
/* (C) 1998-2011, Ullrich von Bassewitz */
|
||||
/* Roemerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
@ -86,8 +86,8 @@ struct Section {
|
||||
struct Fragment* FragLast; /* Pointer to last fragment */
|
||||
unsigned long Offs; /* Offset into the segment */
|
||||
unsigned long Size; /* Size of the section */
|
||||
unsigned long Fill; /* Fill bytes for alignment */
|
||||
unsigned char Align; /* Alignment */
|
||||
unsigned char Fill; /* Fill bytes for alignment */
|
||||
unsigned char AddrSize; /* Address size of segment */
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user