I am using the Clang compiler and always get confused between an assembly file (.s) , object file (.o) , and binary file (.bc). Can anyone explain their difference?
An assembly file (.s) contains machine instructions in human readable form, known as assembly language. An object file contains the same instructions in machine-readable, binary form. Assembly files can be translated to object files by the assembler (as).
An LLVM bitcode file (.bc) contains LLVM instructions in binary form. It can be translated to machine code by the LLVM compiler (llc) or executed directly using the LLVM interpreter (lli).
Not listed in your question are LLVM assembly files (.ll). These contain the same instructions as bitcode files, but in human readable form. They can be turned into bitcode files using the LLVM assembler (llvm-as).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With