Ben Smith wrote:
>
> Hi all,
> I've been trying to compile GASS also, and found that all data that was
supposed to be loaded into IWRAM isn't. What's weirder is that the data isn't
even at the ROM load address.
> A simple test has shown me that Jeff's lnkscrpt will load data into IWRAM
correctly if there are C constants being loaded also, but incorrectly if the
only external data is loaded through an asm file.
This is due to the way GAS works it appears.
I just added this to the GBA Dev FAQs:
http://www.devrs.com/gba/files/gbadevfaqs.php#EmptyBits
GAS Assembly FAQs
Q: When I compile assembly code to go into section .iwram, only empty (0x00)
code is copied from ROM to IWRAM. Why?
A: It is not enough to just do the following:
-.SECTION .iwram
-you need to do the following instead:
-.SECTION .iwram,"ax",%progbits
-or otherwise the code that is put in ROM, to be copied to IWRAM,
-for some reason is composed only of the value 0x00.
-If you use the GCC command line option -save-temps when compiling
-a C file then you will notice similar directives in the resulting .s
-temporary files. Search this file on the keyword 'progbits' for
-other examples.
Jeff