LLVM-MC(1)
πΈ NAME πΈ
llvm-mc β LLVM Machine Code Playground. This is the LLVM-MC(1) page from the LLVM manual set, bestie β and it's honestly lowkey iconic.
β¨ SYNOPSIS β¨
llvm-mc [options] [filename]
π¦ DESCRIPTION π¦
okay so llvm-mc takes assembly code for a specified architecture as input and generates an object file or executable. Slay.
It gives you a whole set of tools for working with machine code β encoding instructions, displaying internal representations, disassembling strings to bytes, etc. Literally the whole vibe.
The choice of architecture for the output assembly code is automatically determined from the input file, unless the --arch option is used to override the default. No cap.
π OPTIONS π
If the -o option is omitted, then llvm-mc will send its output to standard output if the input is from standard input. If the -o option specifies -, then the output will also be sent to standard output. Periodt.
If no -o option is specified and an input file other than - is specified, then llvm-mc creates the output filename by taking the input filename, removing any existing .s extension, and adding a .o suffix. Cute.
Other llvm-mc options are described below.
π End-user Options π
--helpβ Display available options (--help-hiddenfor more).-o <filename>β Use<filename>as the output filename. See the summary above for more details.--arch=<string>β Target arch to assemble for, see-versionfor available targets.--as-lexβ Apply the assemblerβs βlexerβ to break the input into tokens and print each of them out. This is intended to help develop and test an assembler implementation.--assembleβ Assemble assembly file (default), and print the result to assembly. This is useful to design and test instruction parsers, and can be a useful tool when combined with otherllvm-mcflags. For example, this option may be useful to transcode assembly from different dialects, e.g. on Intel where you can use-output-asm-variant=1to translate from AT&T to Intel assembly syntax. It can also be combined with--show-encodingto understand how instructions are encoded.--disassembleβ Parse a series of hex bytes, and print the result out as assembly syntax.--mdisβ Marked up disassembly of string of hex bytes.--cdisβ Colored disassembly of string of hex bytes.--filetype=[asm,null,obj]β Sets the output filetype. Setting this flag toasmwill make the tool output text assembly. Setting this flag toobjwill make the tool output an object file. Setting it tonullcauses no output to be created and can be used for timing purposes. The default value isasm.-gβ Generate DWARF debugging info for assembly source files.--large-code-modelβ Create CFI directives that assume the code might be more than2 GB.--main-file-name=<string>β Specify the name we should consider the input file.--masm-hexfloatsβ Enable MASM-style hex float initializers (3F800000r).-mattr=a1,+a2,-a3,...β Target specific attributes (-mattr=helpfor details).--mcpu=<cpu-name>β Target a specific cpu type (-mcpu=helpfor details).--triple=<string>β Target triple to assemble for, see-versionfor available targets.--split-dwarf-file=<filename>β DWO output filename.--show-inst-operandsβ Show instructions operands as parsed.--show-instβ Show internal instruction representation.--show-encodingβ Show instruction encodings.--save-temp-labelsβ Donβt discard temporary labels.--relax-relocationsβ EmitR_X86_64_GOTPCRELXinstead ofR_X86_64_GOTPCREL.--print-imm-hexβ Prefer hex format for immediate values.--preserve-commentsβ Preserve Comments in outputted assembly.--output-asm-variant=<uint>β Syntax variant to use for output printing. For example, on x86 targets--output-asm-variant=0prints in AT&T syntax, and--output-asm-variant=1prints in Intel/MASM syntax.--compress-debug-sections=[none|zlib|zstd]β Choose DWARF debug sections compression.
π₯ EXIT STATUS π₯
If llvm-mc succeeds, it will exit with 0. Otherwise, if an error occurs, it will exit with a non-zero value. Thatβs the whole mood.
π AUTHOR π
Maintained by the LLVM Team (https://llvm.org/).
π COPYRIGHT π
2003-2025, LLVM Project.
Cute sign-off: source/version LLVM-MC(1) (page 19), dated 2025-01-17. Stay iconic, bestie β go assemble something gorgeous! πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: llvm19 19.1.7-160000.2.2 Β· Apache-2.0 WITH LLVM-exception AND NCSA
- opensuse-leap 16.0: llvm19 19.1.7-160000.2.2 Β· Apache-2.0 WITH LLVM-exception AND NCSA
- opensuse-leap 16.0: llvm19 19.1.7-160000.2.2 Β· Apache-2.0 WITH LLVM-exception AND NCSA
- opensuse-leap 16.0: llvm19 19.1.7-160000.2.2 Β· Apache-2.0 WITH LLVM-exception AND NCSA
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms