LLVM-MC(1)

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

πŸ’– NAME πŸ’–

llvm-mc β€” the manual page for llvm-mc 15, bestie. That's it, that's the name section, periodt. πŸŽ€


✨ DESCRIPTION ✨

OVERVIEW: it's literally a llvm machine code playground 🎠✨ (that's the official vibe, I'm not making it up)

USAGE:

llvm-mc [options] <input file>

OPTIONS: okay so here comes the whole menu. And yes, we're going through every single one β€” no skimming, no "you get the gist", none of that πŸ™…β€β™€οΈπŸ’…

πŸŽ€ Color Options πŸŽ€

  • --color β€” use colors in output, obviously, we love a pop of color. Default is autodetect β€” she figures it out herself, main character energy.

πŸ¦‹ Generic Options πŸ¦‹

  • --help β€” display available options. There's also --help-hidden if you want more, because of course there is. πŸ‘€
  • --help-list β€” display a list of available options. And yup, --help-list-hidden exists too for the extra ones.
  • --version β€” display the version of this program. slay, know thyself.

πŸ‘‘ MC Options πŸ‘‘

  • -I <directory> β€” directory of include files. Where your little include besties live πŸ“
  • -M <string> β€” disassembler options.
  • --arch=<string> β€” target arch to assemble for. Not sure which targets exist? Run -version, she'll tell you. 🌈

🌸 Action to perform: 🌸

  • --as-lex β€” lex tokens from a .s file. Just vibing with the tokens, no assembling πŸ’…
  • --assemble β€” assemble a .s file. This is the default, so if you don't pick anything, this is what you get 🫢
  • --disassemble β€” disassemble strings of hex bytes. Reverse uno card πŸ”„
  • --mdis β€” marked up disassembly of strings of hex bytes. Same thing but with the ✨aesthetic✨

πŸ“ Back to the MC Options πŸ“

  • --compress-debug-sections=<value> β€” choose DWARF debug sections compression. The options are:
    • =none β€” no compression. Raw, unfiltered, iconic.
    • =zlib β€” use zlib compression. Squish it πŸ—œοΈ
  • --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. Your choices, bestie:
    • =asm β€” emit an assembly (.s) file
    • =null β€” don't emit anything at all. For timing purposes only, so like... a little experiment, not a lifestyle 😭
    • =obj β€” emit a native object (.o) file
  • -g β€” generate dwarf debugging info for assembly source files. Debug girlies rise 🧚
  • --large-code-model β€” create cfi directives that assume the code might be more than 2gb away. She's thinking big.
  • --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 tea? Use -mattr=help for details.
  • --mcpu=<cpu-name> β€” target a specific cpu type. Again, -mcpu=help for details, she's helpful like that πŸ’œ
  • --motorola-integers β€” enable binary and hex Motorola integers (%110 and $ABC).
  • -n β€” don't assume the assembly file starts in the text section. Rude to assume, honestly.
  • --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. She doesn't need anybody πŸ¦‹
  • --preserve-comments β€” preserve comments in outputted assembly. Respect the author's notes, fr fr πŸ’–
  • --print-imm-hex β€” prefer hex format for immediate values.
  • --relax-relocations β€” emit R_X86_64_GOTPCRELX instead of R_X86_64_GOTPCREL. Very specific, very cunty, we love her for it.
  • --save-temp-labels β€” don't discard temporary labels. Keep the little guys πŸ₯Ί
  • --show-encoding β€” show instruction encodings.
  • --show-inst β€” show internal instruction representation.
  • --show-inst-operands β€” show instructions operands as parsed. (Yep, that's the exact wording, I'm not touching it πŸ™ˆ)
  • --split-dwarf-file=<filename> β€” DWO output filename.
  • --triple=<string> β€” target triple to assemble for. Wanna know what's available? -version, always -version ✨

okay so real talk, bestie: this whole page is from llvm-mc 15, dated July 2023, and the man page itself answers to LLVM-MC(1). That's the footer, and I'm folding it into a little goodbye kiss instead of a boring line πŸ’‹

mwah πŸ’… thanks for reading the whole thing, you ate that. now go assemble something iconic πŸ‘‘

πŸ“¦ where this page comes from