Author Topic: GCC-TDM problem when calling ld  (Read 63 times)

Offline gomi

  • Jr. Member
  • *
  • Posts: 9
GCC-TDM problem when calling ld
« 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 ?