NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: toolchain/51238: ELF binaries don't carry ELFOSABI_NETBSD in their header



On Tue, Jun 14, 2016 at 07:15:01AM +0000, David Holland wrote:
> The following reply was made to PR toolchain/51238; it has been noted by GNATS.
> 
> From: David Holland <dholland-bugs%netbsd.org@localhost>
> To: gnats-bugs%NetBSD.org@localhost
> Cc: 
> Subject: Re: toolchain/51238: ELF binaries don't carry ELFOSABI_NETBSD in
>  their header
> Date: Tue, 14 Jun 2016 07:10:35 +0000
> 
>  On Mon, Jun 13, 2016 at 09:00:02PM +0000, Joerg Sonnenberger wrote:
>   >  > According to http://netbsd.gw.com/cgi-bin/man-cgi?elf+5 the
>   >  > ELFOSABI_NETBSD is defined but not used:
>   >  
>   >  This is intentional.
>   >  
>   >  > However, a lot of binary programs that inspect elf binaries use the
>   >  > header instead of inspecting PT_NOTE. Unfortunately, those programs
>   >  > will detect NetBSD binaries as UNIX binaries and depending on their
>   >  > logic will use some default value like Linux as the OS the binary is
>   >  > built for, such as Qt Creator.
>   >  
>   >  That's a bug in the programs. There is no advantage to tagging with
>   >  ELFOSABI_NETBSD. AS such: "No bug here, works as intended"
>  
>  ...other than say tagging the binary with the correct OS.
>  
>  Last I checked we don't have the same syscall table as SVR4, except
>  when compat_svr4 is in use, so we hardly have the same OS ABI.

It is not about system calls. It is about the implemented ABI. That's
what we follow, including stack alignment on i386 etc. Looking at
FreeBSD, they had more than enough problems with requiring tagging with
the OSABI. It is a crude and limited hack. Heck, if you don't want to
parse PT_NOTE yourself, call file(1).

Joerg


Home | Main Index | Thread Index | Old Index