YASM_OBJFMTS(7)

πŸ’– yasm_objfmts β€” Yasm Supported Object Formats πŸ’–

okay bestie, so this is the yasm_objfmts(7) page from the Yasm manual β€” it's the whole rundown of every object format Yasm can spit out. manual name is right there in the title, so no need to scroll for it. let's get into it ✨


🌸 SYNOPSIS 🌸

yasm -f objfmt ...

like, that's the whole vibe. you pick your format, you go. πŸŽ€


✨ DESCRIPTION ✨

so the standard Yasm distribution ships with a bunch of modules for different object formats β€” and the object format is Yasm's primary output, so this is kind of a big deal.

you select the object format on the yasm(1) command line using the -f objfmt command line option. that's it. that's the switch. πŸ’…


πŸ¦‹ BIN πŸ¦‹

the "bin" object format makes a flat-format, non-relocatable binary file. it's the one you want for producing DOS .COM executables, or for things like boot blocks. ngl it's lowkey minimal: it supports only 3 sections, and those sections get written in a predefined order to the output file. no negotiating. πŸ“¦


πŸŽ€ COFF πŸŽ€

COFF is an older relocatable object format used on older Unix and compatible systems β€” and also, more recently, on the DJGPP development system for DOS. vintage vibes, still showing up to the party. πŸ•°οΈ


πŸ™ˆ DBG πŸ™ˆ

the "dbg" object format is not a "real" object format β€” bestie, it's not even pretending. what it actually does is create an output file that simply describes:

  • the sequence of calls made to it by Yasm
  • the final object and symbol table information

...all in a human-readable text format. and yeah, in a normal object format all of that would get processed into that format's particular binary representation instead. so this one is not intended for real use β€” it's for debugging Yasm's internals. it's giving backstage pass, not main character. 🫢


πŸ’œ ELF πŸ’œ

the ELF object format really comes in three flavors:

  • "elf32" β€” for 32-bit targets
  • "elf64" β€” for 64-bit targets
  • "elfx32" β€” for x32 targets

ELF is a standard object format in common use on modern Unix and compatible systems (e.g. Linux, FreeBSD). and it has complex support for relocatable and shared objects. it's the it-girl of object formats fr fr. πŸ‘‘


🌈 MACHO 🌈

Mach-O really comes in two flavors:

  • "macho32" β€” for 32-bit targets
  • "macho64" β€” for 64-bit targets

Mach-O is used as the object format on MacOS X. important caveat though: as Yasm currently only supports x86 and AMD64 instruction sets, it can only generate Mach-O objects for Intel-based Macs. so if you were hoping for something else, that's a no from the codebase. πŸ’€


πŸ“ RDF πŸ“

the RDOFF2 object format is a simple multi-section format that was originally designed for NASM. it supports segment references but not WRT references β€” noted, don't try it.

it was designed primarily for simplicity, and it has minimalistic headers for ease of loading and linking. and a complete toolchain β€” linker, librarian, and loader β€” is distributed with NASM. full set, no missing pieces. 🧰


πŸ’… WIN32 πŸ’…

the Win32 object format produces object files compatible with Microsoft compilers (such as Visual C++) that target the 32-bit x86 Windows platform. and plot twist: the object format itself is an extended version of COFF. glow-up. ✨


πŸ”₯ WIN64 πŸ”₯

the Win64 object format produces object files compatible with Microsoft compilers that target the 64-bit "x64" Windows platform. this format is very similar to the win32 object format, but it produces 64-bit objects. same energy, bigger numbers. πŸš€


⭐ XDF ⭐

the XDF object format is essentially a simplified version of COFF. it's a multi-section relocatable format that supports 64-bit physical and virtual addresses. understated, but it does the job. 🀝


πŸ‘€ SEE ALSO πŸ‘€

go read those next, bestie, they're literally right there. 🫢


🌸 AUTHOR 🌸

Peter Johnson <peter@tortall.net>

  • Author.

Copyright Β© 2006 Peter Johnson


and that's the whole page!! πŸ’– this one came from the Yasm manual, dated February 2007, and it lives at page YASM_OBJFMTS(7) β€” so if you ever need to find it again, that's the address. periodt. πŸ‘‘βœ¨

πŸ“¦ where this page comes from