I have a simple assembly program for the architecture AARCH64(ARM64). I can use the cross compiler toolchain aarch64-none-elf to compile it as an ELF file. How can I compile it as a COFF file? What kind of toolchain do I need?
Asked
Active
Viewed 182 times
0
-
Why COFF? That format has been obsolete since the early 1990s. – Aug 03 '19 at 01:51
-
I'm trying to compile a Rust project as a UEFI application on arm. The rust toolchain complies every crate as a COFF file and uses ld.lld to link them as a UEFI file. Now I wanna to add an assembly file and link them together. But the linker only accepts COFF file if the target is UEFI application. – 木小青 Aug 03 '19 at 02:01
-
Are you _sure_ you really mean COFF files? Some tools will display that name for any `.o` file, even if its contents are actually ELF. – Aug 03 '19 at 02:12
-
I think so. I use `llvm-readobj somfile.o` to read the files generated by the rust compiler and it shows: Format:COFF-ARM64 Arch:aarch64. For other elf files it displays `Format: ELF64-aarch64-little Arch:aarch64`. By the way If I add my elf file boot.o to the linker, it displays :error: boot.o is not a COFF file. If I remove my file and just keep the files generated by RUST, it links successfully. – 木小青 Aug 03 '19 at 02:36