GCC binary format output

Victor Roman Archidona daijo at unixevil.info
Wed Jul 12 13:55:47 UTC 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 
Hi all,

I'm porting FreeBSD to Gentoo for the Summer of Code project
"Gentoo/FreeBSD for Amd64", and I need a little help about gcc binary
output when compiling files.

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`. The
problem is that I need the default binary output must be "UNIX -
FreeBSD" and for now I can't fix it without help.

BTW, If the output is "UNIX - System V" I can't run static compiled
files, it shall be fixed changing the output behaviour. For example
with the following small C program:

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
        printf("it works!\n");
        exit(EXIT_SUCCESS);
}

root at localhost ~ # gcc -static test.c -o test
root at localhost ~ # readelf -h test | grep "OS/ABI"
  OS/ABI:                            UNIX - System V
root at localhost ~ # ./test
ELF binary type "0" not known.
- - -su: ./test: cannot execute binary file
root at localhost ~ #

I asked before in gcc-help mailing list but they point to ask here
too. I also provide two links [1] and [2] with previous discussion
about this.

[1]
http://lists.freebsd.org/pipermail/freebsd-hackers/2006-July/017123.html
[2] http://gcc.gnu.org/ml/gcc-help/2006-07/msg00134.html

Any input in this topic will be very apreciated.

Thanks for all in advance,
- - --
Victor Roman Archidona

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32)
 
iD8DBQFEtP9dQ/ddYKMfqaARAlaZAJ9iUkeImjWeSVT+KXyhztA9j1AchACdFurq
TOZxQ/e4paCZHDqen4GBNxk=
=iMM0
-----END PGP SIGNATURE-----



More information about the freebsd-questions mailing list