NASM - The Netwide Assembler

NASM Forum => Other Discussion => Topic started by: gomi on November 21, 2020, 07:13:34 PM

Title: GCC-TDM problem when calling ld
Post by: gomi on November 21, 2020, 07:13:34 PM
Hello, I am trying to use ld on windows with gcc-tdm.

My steps to link:
nasm loader.asm -f elf64 -o loader_entry.o
works.

gcc -O0 -g -ffreestanding -m64 -c loader.c -o loader.o
works.

ld -o loader.bin -m i386pe -Ttext 0x1000 loader_entry.o loader.o --oformat binary
error: ld: cannot perform PE operations on non PE output file 'loader.bin'

What is the reason of that ?