LLVM-MC(1)

πŸ“¦
version 16.0.6 Β· 2 versions
, in ubuntu noble

πŸ’– NAME πŸ’–

llvm-mc β€” bestie, this is the manual page for llvm-mc 16. It's the LLVM machine code playground, and yes we ARE playing in it. πŸ›βœ¨


🌈 DESCRIPTION 🌈

okay so, straight from the source, the OVERVIEW is literally: llvm machine code playground 🎒

And the USAGE? Here's exactly how you run it, no notes:

llvm-mc [options] <input file>

then it's just… OPTIONS: and a whole buffet of them. let's go, we're going down the list one by one because I love you and I refuse to let you skip any. πŸ’…


🎨 Color Options

  • --color β€” use colors in output πŸ’– the default here is autodetect, meaning it peeks around and decides for itself whether your terminal can handle the sparkle. πŸ¦‹

πŸ› οΈ Generic Options

  • --help β€” display available options (and --help-hidden for more, if you're nosy πŸ‘€)
  • --help-list β€” display a list of available options (--help-list-hidden for more, same energy)
  • --version β€” display the version of this program. iconic. πŸ‘‘

🧚 MC Options

  • -I <directory> β€” directory of include files πŸ“
  • -M <string> β€” disassembler options
  • --arch=<string> β€” target arch to assemble for, see -version for available targets

πŸ’« Action to perform:

  • --as-lex β€” lex tokens from a .s file πŸ”€
  • --assemble β€” assemble a .s file. this one is the default, so if you say nothing, it's already doing this. main character behavior fr 🫢
  • --disassemble β€” disassemble strings of hex bytes πŸ”’
  • --mdis β€” marked up disassembly of strings of hex bytes ✨

back to the rest of the MC options πŸ’…

  • --compress-debug-sections=<value> β€” choose DWARF debug sections compression. your vibes-based menu is:
    • =none β€” no compression πŸƒ
    • =zlib β€” use zlib
    • =zstd β€” use zstd
  • --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 (for timing purposes) πŸ‘»
    • =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 (-mattr=help for details) βš™οΈ
  • --mcpu=<cpu-name> β€” target a specific cpu type (-mcpu=help for details) 🧠
  • --motorola-integers β€” enable binary and hex Motorola integers (%110 and $ABC) 🏍️
  • -n β€” don't assume 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, see -version for available targets 🎯

bestie that's the whole list, every single one, I did not gatekeep a thing. 🫢

and that's a wrap on llvm-mc 16, brought to you by the April 2024 edition of the page. go assemble something cute. byeee πŸ’œβœ¨πŸŽ€

πŸ“¦ where this page comes from