#24802 - Gene Ostrowski - Wed Aug 11, 2004 7:41 pm
I was pulling my hair out trying to determine why my sprite data was suddenly garbled.
It turns out that when I look at the memmap of the output, I am seeing:
08043fd1 R _binary_gfx_spr32_raw_start
...which is clearly not being aligned properly, which in turn is messing up my routines that require 4-byte alignment.
This is a problem that just suddenly started-- I've always had my rodata properly aligned without having to do anything special.
Any ideas why this might be happening? Is it objcopy or the linker that would cause this misalignment?
I'm not a linker-script guru, but it shows:
and that appears to be set to align things properly.
Any ideas why it's happening, and more importantly, how I may be able to find a different way to force it to be aligned?
BTW,
I was hoping to fool gcc by re-declaring the array as an int to try to force it to link properly, but it didn't help:
Any thoughts would be greatly appreciated.
_________________
------------------
Gene Ostrowski
It turns out that when I look at the memmap of the output, I am seeing:
08043fd1 R _binary_gfx_spr32_raw_start
...which is clearly not being aligned properly, which in turn is messing up my routines that require 4-byte alignment.
This is a problem that just suddenly started-- I've always had my rodata properly aligned without having to do anything special.
Any ideas why this might be happening? Is it objcopy or the linker that would cause this misalignment?
I'm not a linker-script guru, but it shows:
Code: |
.rodata :
{ *(.rodata) *all.rodata*(*) *(.roda) *(.rodata.*) *(.gnu.linkonce.r*) SORT(CONSTRUCTORS) . = ALIGN(4); /* REQUIRED. LD is flaky without it. */ } = 0xff |
and that appears to be set to align things properly.
Any ideas why it's happening, and more importantly, how I may be able to find a different way to force it to be aligned?
BTW,
I was hoping to fool gcc by re-declaring the array as an int to try to force it to link properly, but it didn't help:
Code: |
extern unsigned int _binary_gfx_spr32_raw_start[]; |
Any thoughts would be greatly appreciated.
_________________
------------------
Gene Ostrowski