Question

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.

Was it helpful?

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.

OTHER TIPS

Use a cross-compiler for specific formats (ARM,MIPS etc.)

Get the entire CODESOURCERY toolchain here for free:

www.codesourcery.com/sgpp/lite_edition.html

GoodLUCK!!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top