Aligned BSS sections...

Other misc things
Post Reply
periata
New member
Posts: 6
Joined: Sat May 05, 2018 10:52 am

Aligned BSS sections...

Post 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?
periata
New member
Posts: 6
Joined: Sat May 05, 2018 10:52 am

Post 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?
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post 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.
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post 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
Post Reply