eholk / Boot2Rust

EFI applications in Rust
Other
205 stars 24 forks source link

Linking with ld #8

Open gz opened 9 years ago

gz commented 9 years ago

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 6 years ago

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 6 years ago

Nice!