Victor Roman Archidona wrote:
> I compiled by hand GCC, and when I compile some file the output format
> is "UNIX - System V". I got this with `readelf -h program`.
> root@localhost ~ # gcc -static test.c -o test
> root@localhost ~ # readelf -h test | grep "OS/ABI"
> OS/ABI: UNIX - System V
I tried a crosscompiler from 'i686-linux-gnu' to the 'x86_64-freebsd6.1'
and got just the same result:
kai@Dell:/data1/home/kai-old/test/tprintf> readelf -h tst_freebsd64.x |
grep OS/ABI
OS/ABI: UNIX - System V
while the binaries in the FreeBSD6.1/amd64 install CD like it's 'gcc'
and 'libc.so.6' had:
kai@Dell:/media/cdrecorder/usr/bin> readelf -h gcc | grep OS/ABI
OS/ABI: UNIX - FreeBSD
kai@Dell:/media/cdrecorder/lib> readelf -h libc.so.6 | grep OS/ABI
OS/ABI: UNIX - FreeBSD
So the executables produced have this wrong type... I would guess GCC
or the GNU 'as'
should be sued for this thing because:
kai@Dell:/data1/home/kai-old/test/tprintf> readelf -h tst_freebsd64.o |
grep OS/ABI
OS/ABI: UNIX - System V
The binutils I used were the latest '2.17.50.0.2' Linux ones from:
ftp.kernel.org/pub/linux/devel/binutils
The GCC version tried was '4.0.3'... I will try gcc-4.1.1 still but
getting this bug fixed also
in gcc-4.0.x could be nice. Anyone knowing this much about binutils and
GCC, which config
etc. setting could cause the 'bad magic'? The right FreeBSD bins have:
Magic: 7f 45 4c 46 02 01 01 09 00 00 00 00 00 00 00 00
but the wrong ones have:
Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00