LLVM-MC(1)

πŸ“¦
version 14.0.6 Β· 5 versions
, in ubuntu questing

πŸ’– NAME πŸ’–

llvm-mc β€” bestie, this is the manual page for llvm-mc 14, and it lives in the User Commands section of the manual. Come sit with me, we're gonna read it together and it's gonna be iconic. 🫢


🌈 DESCRIPTION 🌈

OVERVIEW: llvm machine code playground πŸ›βœ¨

USAGE:

llvm-mc [options] <input file>

OPTIONS:


πŸŽ€ Color Options πŸŽ€

  • --color β€” turns on colors in the output. The default is autodetect, so it just vibes and figures out whether your terminal can handle the sparkle. πŸ’…

✨ Generic Options ✨

  • --help β€” shows you all the available options. Want even more? There's --help-hidden for the extra secret ones. πŸ™ˆ
  • --help-list β€” prints out the list of available options. And yeah, there's --help-list-hidden if you want the hidden list too. πŸ‘€
  • --version β€” shows you the version of this program. That's it, that's the whole job. ⭐

πŸ”₯ MC Options πŸ”₯

  • -I=<directory> β€” directory where the include files live. πŸ“
  • -M=<string> β€” disassembler options. 🧚
  • --arch=<string> β€” the target arch you're assembling for. Not sure which ones exist? Peek at -version for the available targets. πŸ—οΈ

🎬 Action to perform 🎬

  • --as-lex β€” lex tokens out of a .s file. πŸ”€
  • --assemble β€” assemble a .s file. This one is the default, so it's the main character. πŸ‘‘
  • --disassemble β€” disassemble strings of hex bytes. πŸ”
  • --mdis β€” marked up disassembly of strings of hex bytes. ✨

πŸ—œοΈ And the rest of the MC options πŸ—œοΈ

  • --compress-debug-sections=<value> β€” choose how DWARF debug sections get compressed:
    • =none β€” no compression at all, just raw.
    • =zlib β€” use zlib compression.
    • =zlib-gnu β€” use zlib-gnu compression. ⚠️ This one is deprecated, so, like, know that going in.
  • --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> β€” maps file source paths in debug info. πŸ—ΊοΈ
  • --filetype=<value> β€” choose an output file type:
    • =asm β€” emit an assembly (.s) file.
    • =null β€” don't emit anything. It's for timing purposes, not for results. πŸ•
    • =obj β€” emit a native object (.o) file.
  • -g β€” generate dwarf debugging info for assembly source files. πŸ›
  • --large-code-model β€” creates cfi directives that assume the code might be more than 2gb away. Yes, 2gb. Big girl energy. πŸ’ͺ
  • --main-file-name=<string> β€” specifies the name we should consider the input file. 🏷️
  • --masm-hexfloats β€” enables MASM-style hex float initializers, like 3F800000r. 🌸
  • --masm-integers β€” enables binary and hex masm integers, like 0b110 and 0ABCh. πŸ“
  • --mattr=<a1,+a2,-a3,...> β€” target specific attributes. Hit up -mattr=help for the details. πŸŽ›οΈ
  • --mcpu=<cpu-name> β€” target a specific cpu type. Same deal, -mcpu=help has the details. 🧠
  • --motorola-integers β€” enables binary and hex Motorola integers, like %110 and $ABC. 🏁
  • -n β€” don't assume the assembly file starts in the text section. πŸ™…
  • --no-exec-stack β€” this file doesn't need an exec stack. 🚫
  • -o=<filename> β€” output filename. πŸ’Ύ
  • --output-asm-variant=<uint> β€” which syntax variant to use for output printing. 🎨
  • --position-independent β€” position independent. πŸ“
  • --preserve-comments β€” preserves comments in the outputted assembly. 😭 (we love a comment that survives)
  • --print-imm-hex β€” prefers hex format for immediate values. πŸ”‘
  • --relax-relocations β€” emits R_X86_64_GOTPCRELX instead of R_X86_64_GOTPCREL. πŸ”„
  • --save-temp-labels β€” doesn't discard temporary labels. πŸ’Ύ
  • --show-encoding β€” shows instruction encodings. πŸ”¬
  • --show-inst β€” shows the internal instruction representation. 🫧
  • --show-inst-operands β€” shows instruction operands as parsed. 🧩
  • --split-dwarf-file=<filename> β€” DWO output filename. 🌼
  • --triple=<string> β€” the target triple you're assembling for. Again, -version lists the available targets. 🎯

ok bestie that's the whole page, every single option accounted for, no cap. now go forth and assemble something gorgeous. πŸ’…βœ¨

llvm-mc 14 Β· May 2025 Β· LLVM-MC(1) β€” mwah, love u, bye! πŸŽ€πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from