Today (March, 29 2006) binutils TOT configured on i686-pc-linux-gnu using ../binutils/configure --target=i386-pc-solaris2.11 --enable-64-bit-bfd --prefix=/srv/local/cross and successfully build. /binutils/objdump: /srv/local/cross/i386-pc-solaris2.11/lib/amd64/crti.o: File format not recognized crti.o file is got from OpenSolaris (snv_33) /usr/lib/amd64/crti.o.
Not a bug. You need to build binutils with support for all targets of interest. In this case, you probably want to add --enable-targets=x86_64-elf to your configure line (or --enable-targets=all). If that doesn't work, then it means that binutils doesn't have support for amd64 on solaris.
Thanks for reply. When configured with --enable-targets=all, build failed make[4]: *** No rule to make target `../../binutils/ld/emulparams/elf32bfinfd.sh', needed by `eelf32bfinfd.c'. Stop. make[4]: Leaving directory `/home/arybchik/cvs/build/ld' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/home/arybchik/cvs/build/ld' make[2]: *** [all] Error 2 make[2]: Leaving directory `/home/arybchik/cvs/build/ld' make[1]: *** [all-ld] Error 2 make[1]: Leaving directory `/home/arybchik/cvs/build' make: *** [all] Error 2 When it is configured with --enable-targets=x86_64-elf, build works fine, but the result is the same. The most interesting point here is that multiplatform binutils (2.15) from Debian Sarge works fine.
Created attachment 1128 [details] Ignore (accept) SHT_LOOS...SHT_HIOS sections in elf64 Just FYI, attached patch is sufficient to make binutils happy on Solaris. Problem is that there is strange section named .SUNW_signature of an OS specific type piggybacked on files which come with Solaris. Problem is regression from 2.15.92 binutils. Although they did not behave quite correctly (they've completely ignored section, even not showing it in objdump -h output), they did not fail with quite unexpected error that file format is not recognized. eu-readelf says: There are 11 section headers, starting at offset 0x308: Section Headers: [Nr] Name Type Addr Off Size ES Flags Lk Inf Al [ 0] NULL 00000000 00000000 00000000 0 0 0 0 [ 1] .text PROGBITS 00000000 00000040 00000000 0 AX 0 0 4 [ 2] .data PROGBITS 00000000 00000040 00000000 0 WA 0 0 4 [ 3] .bss NOBITS 00000000 00000040 00000000 0 WA 0 0 4 [ 4] .comment PROGBITS 00000000 00000040 00000025 0 0 0 1 [ 5] .init PROGBITS 00000000 00000070 00000004 0 AX 0 0 16 [ 6] .fini PROGBITS 00000000 00000080 00000004 0 AX 0 0 16 [ 7] .shstrtab STRTAB 00000000 00000084 00000051 0 0 0 1 [ 8] .symtab SYMTAB 00000000 000000d8 00000108 24 9 9 8 [ 9] .strtab STRTAB 00000000 000001e0 00000014 0 0 0 1 [10] .SUNW_signature 0x6ffffff6 00000000 000001f4 0000010e 0 E 0 0 1 Thanks, Petr Vandrovec
Comment on attachment 1128 [details] Ignore (accept) SHT_LOOS...SHT_HIOS sections in elf64 >--- binutils-2.17/bfd/elf64-x86-64.c.orig 2006-03-23 09:23:09.000000000 +0100 >+++ binutils-2.17/bfd/elf64-x86-64.c 2006-06-30 06:42:19.000000000 +0200 >@@ -3439,13 +3439,11 @@ > const char *name, > int shindex) > { >- if (hdr->sh_type != SHT_X86_64_UNWIND) >- return FALSE; >- >- if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex)) >- return FALSE; >- >- return TRUE; >+ if (hdr->sh_type == SHT_X86_64_UNWIND || >+ (hdr->sh_type >= SHT_LOOS && hdr->sh_type <= SHT_HIOS)) { >+ return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); >+ } >+ return FALSE; > } > > /* Hook called by the linker routine which adds symbols from an object
Created attachment 1129 [details] Oops, this one compiles. Sorry.