Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List of targets supported by binutils

Tags:

binutils

I am following a website ( http://wiki.osdev.org/GCC_Cross-Compiler ) to learn how to cross compile some code for different architectures. So, the first step is to download and compile Binutils for a specific target.

The site say to assign the varible TARGET with i686-elf because then the binutils will be able to handle code in the format specified by $TARGET.

export PREFIX="$HOME/opt/cross"
export TARGET=i686-elf
export PATH="$PREFIX/bin:$PATH"

So, my question is that

Can i get a list of targets that is supported by Binutils?

If the variable TARGET can contain anything or must be something that is supported by Binutils i.e would there be an error during compiling the source code of binutils, if the TARGET is something that binutils doesnt understand?

like image 942
infoclogged Avatar asked Mar 23 '17 20:03

infoclogged


People also ask

What's included in binutils?

Contents of Binutils. Binutils is a collection of software development tools containing a linker, assembler and other tools to work with object files and archives.

Does binutils GCC?

So the binutils package is a required dependency for the gcc package (with many other dependencies, probably including libc and libc-devel , but if you really want you could use some other libc like MUSL libc; the libc is generally providing the dynamic linker like /lib/ld-linux.so* ).


1 Answers

Never saw an answer for this question, so I'll give it the ol college attempt for those coming from various search engines. If one downloads or clones binutils from sourceware

git clone git://sourceware.org/git/binutils-gdb.git

And then reads this explanation of binutils

https://sourceware.org/binutils/binutils-porting-guide.txt

You will find the answer.


TL;DR

Read the contents of config.bfd within the bfd directory


All the supported targets are listed within

cd /path/to/git/clone/of/binutils/bfd

Notice the files with elf32-[SOME_NAME].c and elf64-[SOME_NAME].c in the above mentioned directory, those are your supported targets.

Ex

elf32-cr16.c

would translate to,

--target=cr16-elf
like image 109
ipatch Avatar answered Oct 19 '22 17:10

ipatch