Page 1 of 1

Aligned BSS sections...

Posted: Thu May 17, 2018 11:42 pm
by periata
... maybe I'm misunderstanding how this is supposed to work, but I've put a table in a BSS section that needs to be aligned to a 256-byte address (the table contains a linked list that uses 8-bit addresses relative to the start of the table, so I can just load the low byte of the register I'm using from a pointer in order to follow it) ... however, on compiling I get a warning:

Code: Select all

Warning: SECTION __bss_align_256_head is not aligned with start address 0x5b05
I was kind of assuming that the previous section would get padded out until it aligns at an appropriate address, i.e. this section would basically get moved up to 0x5c00 and space would be left before it. How do I get this to happen?

Posted: Thu May 17, 2018 11:48 pm
by periata
.... I can force it to align by writing it like this:

Code: Select all

        
        SECTION bss_align_256
        ORG 0x5c00
but then if my non-aligned items fill up the space, this will start failing. Can I get this section to automatically align to the lowest available slot, i.e. if 5c00 isn't available move on to 6000, and so on?

Posted: Fri May 18, 2018 4:41 am
by alvin
It's an issue that was just fixed today :)
https://github.com/z88dk/z88dk/issues/717

I'll be making the necessary changes tonight.

Posted: Thu May 24, 2018 3:53 pm
by alvin
It took me a while to get back to this, sorry.

Align is almost fixed, the outstanding issue:
https://github.com/z88dk/z88dk/issues/762