Search code examples
clinuxassemblygnugnu-assembler

What's the output object file format of GNU assembler as?


I have checked the assembler options of GNU assembler as and I didn't find an option to specify the output object file format. If I am using the following command

as -o foobar.o foobar.s

What object file format will I get?

The as manual says that "The GNU as can be configured to produce several alternative object file formats." But how? How can I change it to a ELF format?

Many thanks.


Solution

  • On linux the output from gas is ELF already, it is unlikely you have a version which is building the old a.out format, or that you are using a cross compiler to say build to MachO or PE.