List of target formats supported by gcc and ld

Programming, for all ages and all languages.
Post Reply
Rival
Posts: 11
Joined: Sat Feb 05, 2011 6:05 am
Location: I gotta go

List of target formats supported by gcc and ld

Post by Rival »

It's been more than a while I've been googling on this topic. Few years back, I came across a page which listed all the target formats and target machines supported by both gcc and ld. But recently, that page seems to go out of existence. I even tried checking gcc manual and configure options. It seems they have skipped this part altogether.

If anyone have a link that I may find useful, please post in.

Edit: I seem to recall that ld had a switch that enlists object file formats it is configured to support. Well, I can't remember the exact switch so if anyone knows, that too would be very helpful.
User avatar
BrightLight
Member
Member
Posts: 901
Joined: Sat Dec 27, 2014 9:11 am
Location: Maadi, Cairo, Egypt
Contact:

Re: List of target formats supported by gcc and ld

Post by BrightLight »

:roll: :roll:
OSDev Wiki wrote:Supports most known input formats (ELF, DJGPP/COFF, Win32/COFF, A.Out, etc)
Supports most known output formats (ELF, Win32/PE, A.Out, COFF, etc)
http://wiki.osdev.org/LD
You know your OS is advanced when you stop using the Intel programming guide as a reference.
Rival
Posts: 11
Joined: Sat Feb 05, 2011 6:05 am
Location: I gotta go

Re: List of target formats supported by gcc and ld

Post by Rival »

omarrx024 wrote:ELF, DJGPP/COFF, Win32/COFF, A.Out
Not even 1% of all object formats supported by ld.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: List of target formats supported by gcc and ld

Post by Combuster »

It's easy to skip over what's been compiled in:

Code: Select all

$ x86_64-pe-ld --help
(...)
x86_64-pe-ld: supported targets: pe-x86-64 pei-x86-64 pe-bigobj-x86-64 elf64-x86-64 elf64-l1om elf64-k1om pe-i386 pei-i386 elf32-i386 elf64-little elf64-big elf32-little elf32-big plugin srec symbolsrec verilog tekhex binary ihex
x86_64-pe-ld: supported emulations: i386pep i386pe
(...)
As to what it could support, assume everything that's not 16-bit or a trade secret of sorts.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Rival
Posts: 11
Joined: Sat Feb 05, 2011 6:05 am
Location: I gotta go

Re: List of target formats supported by gcc and ld

Post by Rival »

Combuster wrote:It's easy to skip over what's been compiled in:

Code: Select all

$ x86_64-pe-ld --help
(...)
x86_64-pe-ld: supported targets: pe-x86-64 pei-x86-64 pe-bigobj-x86-64 elf64-x86-64 elf64-l1om elf64-k1om pe-i386 pei-i386 elf32-i386 elf64-little elf64-big elf32-little elf32-big plugin srec symbolsrec verilog tekhex binary ihex
x86_64-pe-ld: supported emulations: i386pep i386pe
(...)
As to what it could support, assume everything that's not 16-bit or a trade secret of sorts.
Great!
rdp
Posts: 4
Joined: Sat Apr 25, 2015 6:15 pm
Libera.chat IRC: rdp

Re: List of target formats supported by gcc and ld

Post by rdp »

For my ELLCC clang based cross development tool project, I build ld to support quite a variety of targets. ld --help:

Code: Select all

...
bin/ecc-ld: supported targets: elf64-x86-64 elf32-i386 elf32-x86-64 a.out-i386-linux pei-i386 pei-x86-64 elf64-l1om elf64-k1om elf64-little elf64-big elf32-little elf32-big elf64-littleaarch64 elf64-bigaarch64 elf32-littleaarch64 elf32-bigaarch64 elf32-littlearm elf32-bigarm elf32-bigmips elf32-littlemips elf64-bigmips elf64-littlemips elf32-littlenios2 elf32-bignios2 elf32-powerpc aixcoff-rs6000 elf32-powerpcle ppcboot elf64-powerpc elf64-powerpcle aixcoff64-rs6000 aix5coff64-rs6000 elf32-microblaze elf32-microblazeel elf32-sparc a.out-sunos-big elf32-tradbigmips elf32-tradlittlemips ecoff-bigmips ecoff-littlemips elf32-ntradbigmips elf64-tradbigmips elf32-ntradlittlemips elf64-tradlittlemips a.out-sparc-linux elf64-sparc pe-x86-64 pe-bigobj-x86-64 pe-i386 srec symbolsrec verilog tekhex binary ihex
bin/ecc-ld: supported emulations: elf_x86_64 elf32_x86_64 elf_i386 i386linux elf_l1om elf_k1om aarch64elf aarch64elf32 aarch64elf32b aarch64elfb armelf armelfb elf32ebmip elf32elmip nios2elf elf32ppc elf32ppclinux elf32ppcsim elf64ppc elf32microblaze elf32microblazeel elf32_sparc aarch64linux aarch64linuxb aarch64linux32 aarch64linux32b armelfb_linux_eabi armelf_linux_eabi armelf_linux armelfb_linux elf32btsmip elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip nios2linux elf32mb_linux elf32mbel_linux sparclinux elf64_sparc sun4 i386pep i386pe
...
http://ellcc.org

-Rich
Post Reply