eholk/Boot2Rust

Linking with ld

gz opened this issue · 2 comments

gz commented

Just wanted to mention that for me, linking with my regular ubuntu linker (GNU ld (GNU Binutils for Ubuntu) 2.24) seemed to work just fine with using LDEMULATION:

LDEMULATION="i386pe" ld --oformat pei-x86-64 --subsystem 10 -pie -e efi_start build/boot.o -o img/efi/boot/bootx64.efi

gurry commented

Linking with link.exe on Windows works fine as well. It is in fact easier than linux because you don't need cross compilation. All you do is pass the flag /subsystem:EFI_APPLICATION to the native link.exe. After all an EFI application is nothing but a PE file which is a format native to Windows.

eholk commented

Nice!