I'm using Bartman's toolchain and I'd like to use gcc/ld to compile and link in order to get some benefits from its link time optimizations (-flto) or other.whole program optimizations.
The demo has a mix of c and asm object files. Both vasm and gcc outputs elf object files:
When linking with vlink everything works fine. vlink invocation:
vlink -bamigahunk -S -s -sd -sc -o $(PRG) $(OBJ)
But when linking with gcc or ld the demo crashes when entering certain asm files. If I rewrite those asm files to be pc relative it seems to fix the issue. However, I'd like to know whether I'm just missing some option for ld/gcc that could fix this rather than having to make all my old cranky asm pc relative? (vlink doesn't require this for sure)
Here is my linker invocation:
m68k-amiga-elf-ld -r -nostdlib --emit-relocs --verbose $(OBJ) -o demo.elf
elf2hunk demo.elf demo.hunk
Any idea? What parameters are you using?