This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Intel 80386, version 1 (SYSV) vs Intel 80386, version 1 (GNU/Linux)


James Cloos <cloos@jhcloos.com> writes:

> I tried compiling some stuff on my amd64 box for an ia32 box, using -m32
> and and appropriate -march.  The resulting libraries worked fine when
> compiled static, but failed when compiled dynamic.
>
> The destination box's executables and libraryies report:
>
> foo: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
>      dynamically linked (uses shared libs), for GNU/Linux 2.6.9,
>      not stripped
>
> whereas the files generated by my amd64 box report:
>
> bar: ELF 32-bit LSB executable, Intel 80386, version 1 (GNU/Linux),
>      dynamically linked (uses shared libs), for GNU/Linux 2.6.9,
>      not stripped
>
> In readelf format, that is:
>
>   OS/ABI:                            UNIX - System V
> vs:
>   OS/ABI:                            UNIX - Linux
>
> I tried using -Wl,--hash-style=sysv, but the libraries and executables
> still say Linux rather than SYSV.  (The .o files say SYSV.)
>
> How do I force the former os/abi?

It is very unlikely that this is your problem.

However, to answer your question, the OS/ABI field will be set to
GNU/Linux if your program has any symbols whose type is STT_GNU_IFUNC.
I assume you didn't add any such symbols yourself, so they almost
certainly come from glibc.  There is nothing you can do to force the
OS/ABI field to be System V other than avoid using STT_GNU_IFUNC
symbols.  (You could binary edit the field, of course, but it wouldn't
change the fact that you are using a GNU specific symbol type.)

This of course suggests that your problem is that you are building on a
system with a newer version of glibc than the system on which you want
to run the program.  This doesn't work in general; glibc is backward
compatible but not forward compatible.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]