gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > Mysterious IWRAM padding.

#24074 - cosmic4z - Tue Jul 27, 2004 2:03 pm

I've recently changed the makefile of my project and now all my IWRAM data variables are being padded.

Just about all the following variables are u32 / s32 (BG0 & BG1 are structures).

The following is a portion of my mapfile.

Code:

COMMON         0x03000fa0      0x184 help.o
                                  0x0 (size before relaxing)
                0x03000fa0                HELP_SI_used
                0x03000fc0                HELP_SI
                0x030010e0                HELP_pAnim
                0x03001100                HELP_pText
                0x03001120                HELP_XRAM_pRewind
 *fill*         0x03001124       0x1c 00
 COMMON         0x03001140      0x124 BG.o
                                  0x0 (size before relaxing)
                0x03001140                BGI_Index
                0x03001160                BG_pChars
                0x03001180                BG0
                0x030011c0                BG1
                0x03001200                BGI_Height
                0x03001220                BGI_Width
                0x03001240                BG_pBanks
                0x03001260                BG_pWMap
 *fill*         0x03001264       0x1c 00
 COMMON         0x03001280      0x5a4 SE.o
                                  0x0 (size before relaxing)
                0x03001280                SE_TotalSI
                0x030012a0                SE_ScriptSI
                0x030012c0                SE_iRemove
                0x030012e0                SE_Trigger
                0x030016e0                SE_pAutoTriggers
                0x03001700                SE_Frame
                0x03001720                SE_pSI
                0x03001740                SE_pStep
                0x03001760                SE_UserSI
                0x03001780                SE_Remove_pSI
                0x03001800                SE_pScript
                0x03001820                SE_pInitSI
 *fill*         0x03001824       0x1c 00


I am now using a makefile - link script combo (compliing / linking with devkitadv).

How come IWRAM is being padded like this ? ... Is it something in the link script ?
_________________
Qwak - www.qwak.co.uk | Forum - www.qwak.co.uk/forum/

#24082 - Miked0801 - Tue Jul 27, 2004 6:09 pm

Yes it is the link scripts - and if you figure out how to fix it, please let me know :)

#24096 - col - Tue Jul 27, 2004 10:06 pm

Can you post some more details.

Which version of Devkitadv?
Are you using the default crt0.o and lnkscript files?
What are the linker and compiler options in your makefile?
fwiw, I am using Devkitadv-r5-beta-3 with the default lnkscript and crt0.o. The only change is that crt0.o has been recompiled with different stack offsets. With this setup, I'm getting no padding in globals or static class members.

cheers

Col

#24131 - cosmic4z - Wed Jul 28, 2004 10:41 am

Sure thing Miked0801.

col - I am using:

DEVKIT:
Devkit Advance 5 beta 3.

LINK SCRIPT:
Linker Script v1.2 by Jeff Frohwein

CRT0:
crt0.S v1.26 by Jeff Frohwein (modified by James Daniels/Apex Design for AAS).

COMPILE FLAGS:
CFLAGS = -ggdb -mthumb-interwork -fomit-frame-pointer -mapcs-32 -mcpu=arm7tdmi -ffast-math -fno-exceptions -fno-rtti
THUMB = -mthumb -O -ffixed-r14 -funroll-loops

LINK FLAGS:
LDFLAGS = -mthumb-interwork -Xlinker -Map $(MAP) -nostartfiles -Tlnkscript



I can post the full versions of any of the above if anyone thinks that will help.

I will also post the fix should I find one.

- Jamie.
_________________
Qwak - www.qwak.co.uk | Forum - www.qwak.co.uk/forum/