[cc65] alignment bug?

From: Per Olofsson <magervalp1gmail.com>
Date: 2009-04-03 15:31:19
Using this .cfg:

MEMORY {
    ZEROPAGE: start = $68, size = 8;
    LOADADDR: start = $3ffe, size = 2;
    VICBANK1: start = $4000, size = $4000, fill = yes;
    VICBANK2: start = $8000, size = $4000;
}
SEGMENTS {
    ZEROPAGE: load = ZEROPAGE, type = zp;
    LOADADDR: load = LOADADDR, run = VICBANK1, type = ro;
    GFXBANK1: load = VICBANK1, type = rw, align = $4000;
    CODE: load = VICBANK2, type = ro, align = $0100;
    RODATA: load = VICBANK2, type = ro, align = $0100;
    DATA: load = VICBANK2, type = rw, align = $0100;
    BSS: load = VICBANK2, type = bss, align = $0100;
}

and this code:

	.segment "GFXBANK1"
	
	.align $2000
	.incbin "raw_image.prg", $0002, $1f40
	
	.align $0400
	.incbin "raw_image.prg", $2002, $03e8

I get:

ld65: Warning: Memory area overflow in `VICBANK1', segment `GFXBANK1'
(9192 bytes)
ld65: Error: Cannot generate output due to memory area overflow

If I expand the memory area to cover the overflow, the map file says:

Name                  Start   End     Size
--------------------------------------------
LOADADDR              004000  004001  000002
GFXBANK1              006000  0083E7  0023E8
CODE                  008000  008022  000023

It appears that ld65 adds space for alignment, even though the segment
is already aligned.
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Fri Apr 3 15:31:25 2009

This archive was generated by hypermail 2.1.8 : 2009-04-03 15:31:28 CEST