Executable/Toolchain questions

Ian Lance Taylor ian@airs.com
Sat May 14 03:12:00 GMT 2005


Bahadir Balban <bahadir.balban@gmail.com> writes:

This is a question about the linker, so this is the wrong mailing
list.  You should be sending to a binutils mailing list.  See
    http://sourceware.org/binutils/

> 1) If I build a test.o, and try to convert it to flat binary by:
> 
> arm-elf-ld test.o -o test.bin -Ttext 0x8000 -e main --oformat binary -N,
> 
> it complains for specifying an output format for an arm-elf able ld.
> it makes sense for me since the name is "arm-elf"-ld. But then what ld
> should I have to do this?

Use the arm-elf linker to create an arm-elf file, and then objcopy to
convert to binary format.

> 2) The fields in a tool configuration are cpu, os, manufacturer, and
> kernel. So elf is specified as part of cpu field perhaps?

"elf" is conventionally used in the OS field.  It is conventionally
used for an embedded system, with no particular OS, using the ELF
object file format.

> Why do I
> need to have an object-format-specific toolchain compiled?

You need to specify the default.

> Can't I
> produce many formats with one toolchain?

Yes, you can.  See the --enable-target configure option.

In principle, the fact that the arm-elf linker won't produce anything
other than arm-elf output is a bug.  But it is not likely to be fixed,
since the workaround of using objcopy is so simple.

Ian



More information about the Gcc-help mailing list