LLVM-MC(1)

πŸ“¦
version 13.0.1 Β· 3 versions
, in ubuntu jammy

✨ 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 is autodetect, so it figures out for itself whether your terminal is that girl. 🌸

πŸ‘‘ Generic Options:

  • --help β€” display the available options. Pass --help-hidden if you want the extra secret menu. πŸ™ˆ
  • --help-list β€” display a list of the available options. Pass --help-list-hidden for 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 .s file.
  • --assemble β€” assemble a .s file. 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 (0b110 and 0ABCh).
  • --mattr=<a1,+a2,-a3,...> β€” target specific attributes. Need the deets? -mattr=help. πŸ¦‹
  • --mcpu=<cpu-name> β€” target a specific cpu type. Again, -mcpu=help for details. ✨
  • --motorola-integers β€” enable binary and hex Motorola integers (%110 and $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 β€” emit R_X86_64_GOTPCRELX instead of R_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, -version lists 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