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 > ??? generate a DevKit Advance/gcc memory map

#3503 - wtuck - Wed Feb 26, 2003 7:15 am

what option and where do you put the option in order to generate a memory mape of my compiled SW using DevKit Advance/gcc ?

I'm trying to figure out if the code I compiled to be located in iwram is really getting there.

Thanks

#3514 - Paul Shirley - Wed Feb 26, 2003 1:48 pm

removed

Last edited by Paul Shirley on Sun Mar 28, 2004 9:44 pm; edited 1 time in total

#3529 - dragor - Wed Feb 26, 2003 6:12 pm

Code:

-Wl,-Map somefile.map [other linker options]


put that option on the command line where you compile your elf and you'll have a mapfile generated
_________________
Sum Ergo Cogito

#3531 - wtuck - Wed Feb 26, 2003 7:02 pm

I tried -Map x.map and -map x.map both gave me this error

gcc: x.map: No such file or directory
make: *** [x.elf] error 1


this is my makefile command line:

CFLAGS =
-O1 -Wall -save-temps -fverbose-asm -mthumb-interwork -mlong-calls
LDFLAGS =
-lm -w -mthumb-interwork -mlong-calls


$(TARGET).elf : $(OFILES)
gcc -Map $(TARGET).map $(LDFLAGS) $(OFILES) -o $(TARGET).elf

#3534 - Paul Shirley - Wed Feb 26, 2003 7:41 pm

removed

Last edited by Paul Shirley on Sun Mar 28, 2004 9:44 pm; edited 1 time in total

#3536 - dragor - Wed Feb 26, 2003 8:42 pm

Yes the -Wl option is important and it won't work unless you have it.

Also, this will work:
Code:

gcc  -Wl,-Map $(TARGET).map $(LDFLAGS) $(OFILES) -o $(TARGET).elf


but this won't:
Code:

gcc  -Wl, -Map $(TARGET).map $(LDFLAGS) $(OFILES) -o $(TARGET).elf


It's important that there's no space after the -Wl,
_________________
Sum Ergo Cogito

#3537 - Paul Shirley - Wed Feb 26, 2003 8:53 pm

removed

Last edited by Paul Shirley on Sun Mar 28, 2004 9:44 pm; edited 1 time in total

#3540 - wtuck - Wed Feb 26, 2003 11:23 pm

Hi All,

Thanks for the help. the only one I tried was:

Code:
gcc -Wl,-Map,$(TARGET).map


It worked great....