Summary
In this final chapter, you discovered how textual assembly files are lowered into object files and learned how to leverage the LLVM infrastructure to implement this lowering.
More specifically, you learned that the LLVM infrastructure hinges on three classes that you must provide for your target: MCAsmBackend
, MCCodeEmitter
, and MCObjectTargetWriter
. These classes are respectively responsible for handling the fixups, encoding the instructions, and recording the relocations.
While the content of this chapter will not be enough for you to confidently write an assembler, we believe it gives you the necessary background to get you started in your journey as a binary tools writer.
We hope you enjoyed learning with us and wish you good luck in your compiler backend journey or whatever LLVM-related activities you decide to pursue, such as writing your own tools, improving an existing backend, or writing your own backend, to mention a few!