Author Topic: FreeBSD default object file format  (Read 10478 times)

Offline nulluse

  • Jr. Member
  • *
  • Posts: 3
FreeBSD default object file format
« on: April 12, 2016, 06:23:58 PM »
Was trying to compile a small sample program under FreeBSD for the very 1st time and the format produced was a.out while currently FreeBSD uses elf32/elf64 depending on the architecture. I asked the FreeBSD folks and they said that as nasm installs from the ports, then it is maintainer's responsibility to default the format to that of the operating system.

Under Linux nasm compiles to ELF by default (but it also installs from the repos, so it undergoes some form of packaging by the distro makers).

Would nasm team be the right folks to ask to default the object file format to ELF in 32 or 64 bit depending on the machine on FreeBSD?

Thank you!

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: FreeBSD default object file format
« Reply #1 on: April 12, 2016, 08:25:34 PM »
Nasm "usually" defaults to "-f bin". It is easy to change the default output format - see outform.h. It is   possible that distro creators do this, but I'm not aware of it. Use "nasm -hf" for a list of compiled-in output formats - default is marked with an asterisk. AFAIK, no one uses this "feature". Correct me if I'm wrong.

Best,
Frank