Linking problem

Ask anything your want about Megadrive/Genesis programming.

Moderator: BigEvilCorporation

Post Reply
KanedaFr
Administrateur
Posts: 1139
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Linking problem

Post by KanedaFr » Fri Apr 13, 2007 2:43 pm

Hello
some problem with the linker...I don't know exactly how it works, I never went deeper in the manual so I perhaps asks something trivial

here is my prblem...
let's say I have sega.s, main.c, resource.s
in resource.s I have only

Code: Select all

.globl mydata
mydata:
my goal is to make a rom when you can add anything at the end so it can be handled by the program in main.c, calling mydata

I'm unable to link this with the result.bin ending by nothing...
I always have some data at the end of the file...so I assume it's the linker which add data/text/what ever....

the syntax I use
gcc -b 68k -O1 -c -o sega.o sega.s
gcc -b 68k -m68000 -O1 -c -I..\\..\\xgcc\\68K\\2_8_1\\INCLUDE\\ main.c
gcc -b 68k -O1 -c -o resource.o resource.s
gcc -Xlinker -L..\\..\\..\\xgcc\\68k\\2_8_1\\m68000\\ -b 68k -T md.ld -nostdlib -o blank. FILES -lm -lc -l135 -lgcc -lg
68k-objc -O binary blank. blank.bin

where FILES is
INPUT(sega.o)
INPUT(main.o)
INPUT(resource.o)


any idea someone ??

KanedaFr
Administrateur
Posts: 1139
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr » Mon Apr 16, 2007 11:59 am

ok...I finally found the problem...
I needed to modify the linker script file...
cool, I finished another thing! release tomorrow...

Post Reply