LLVM-MC(1)
β¨ NAME β¨
okay so bestie, pull up a chair β this is the manual page for llvm-mc, version 13, section 1 (User Commands). It's literally the coolest little playground for machine code and I'm gonna walk you through every single flag, no skips, no cap. π
π DESCRIPTION π
π OVERVIEW
llvm machine code playground β that's it, that's the vibe. It's giving sandbox energy. β¨
π¦ USAGE
llvm-mc [options] <input file>
π OPTIONS:
bestie listen. There are a LOT of options. Do not panic. We're going through all of them together, in order, and every single one is staying right where it is. π«Ά
β Color Options:
--colorβ use colors in output, obvi. The default isautodetect, so it figures out for itself whether your terminal is that girl. πΈ
π Generic Options:
--helpβ display the available options. Pass--help-hiddenif you want the extra secret menu. π--help-listβ display a list of the available options. Pass--help-list-hiddenfor more. π--versionβ display the version of this program. iykyk. β¨
π₯ MC Options:
-I=<directory>β directory of include files.-M=<string>β disassembler options.--arch=<string>β target arch to assemble for. Not sure what's available? Run-version, it'll tell you. π
π§ Action to perform:
--as-lexβ lex tokens from a.sfile.--assembleβ assemble a.sfile. This one's the default, so if you just hit enter, this is what you get. main character energy fr. β--disassembleβ disassemble strings of hex bytes.--mdisβ marked up disassembly of strings of hex bytes.--compress-debug-sections=<value>β choose your DWARF debug sections compression, bestie:=noneβ no compression.=zlibβ use zlib compression.=zlib-gnuβ use zlib-gnu compression. heads up: this one is deprecated. π
--defsym=<string>β defines a symbol to be an integer constant.--fdebug-compilation-dir=<string>β specifies the debug info's compilation dir.--fdebug-prefix-map=<= separated key-value pairs>β map file source paths in debug info.--filetype=<value>β choose an output file type:=asmβ emit an assembly (.s) file.=nullβ don't emit anything at all. It's for timing purposes, so think of it as the "just vibing, producing nothing" mode. π=objβ emit a native object (.o) file.
-gβ generate dwarf debugging info for assembly source files.--large-code-modelβ create cfi directives that assume the code might be more than 2gb away.--main-file-name=<string>β specifies the name we should consider the input file.--masm-hexfloatsβ enable MASM-style hex float initializers (3F800000r).--masm-integersβ enable binary and hex masm integers (0b110and0ABCh).--mattr=<a1,+a2,-a3,...>β target specific attributes. Need the deets?-mattr=help. π¦--mcpu=<cpu-name>β target a specific cpu type. Again,-mcpu=helpfor details. β¨--motorola-integersβ enable binary and hex Motorola integers (%110and$ABC).-nβ don't assume the assembly file starts in the text section.--no-exec-stackβ file doesn't need an exec stack.-o=<filename>β output filename.--output-asm-variant=<uint>β syntax variant to use for output printing.--position-independentβ position independent.--preserve-commentsβ preserve comments in outputted assembly.--print-imm-hexβ prefer hex format for immediate values.--relax-relocationsβ emitR_X86_64_GOTPCRELXinstead ofR_X86_64_GOTPCREL.--save-temp-labelsβ don't discard temporary labels.--show-encodingβ show instruction encodings.--show-instβ show internal instruction representation.--show-inst-operandsβ show instructions operands as parsed.--split-dwarf-file=<filename>β DWO output filename.--triple=<string>β target triple to assemble for. And yes,-versionlists the available targets, we been knew. π
and that's the whole page, bestie, you ate it. π
this has been llvm-mc version 13, from July 2023, manual page LLVM-MC(1) β mwah, go compile something iconic πβ¨
π¦ where this page comes from
- ubuntu jammy: llvm-13 1:13.0.1-2ubuntu2.2 Β· APACHE-2-LLVM-EXCEPTIONS
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms