Re: ELF e_ident[EI_OSABI] not being set on objects?

Rob Whitlock <[email protected]>
Newsgroups gmane.os.netbsd.ports.arm
Message-ID <[email protected]>
> On Jan 8, 2025, at 7:46 AM, Joseph Koshy <[email protected]> wrote:
> 
> I noticed that NetBSD/evbarm binaries are being built as 'SysV' binaries.
> 
> nbarm% readelf -h /usr/bin/nm | grep OS/ABI
>  OS/ABI:                            UNIX - System V
> nbarm% readelf -h /usr/lib/libc.so | grep OS/ABI
>  OS/ABI:                            UNIX - System V
> 
> This was on recent -current:
> 
> % uname -a
> NetBSD nbarm 10.99.12 NetBSD 10.99.12 (GENERIC64) #0: Fri Dec 27
> 00:57:53 UTC 2024
> [email protected]:/usr/src/sys/arch/evbarm/compile/GENERIC64
> evbarm
> 
> Any idea why the e_ident[EI_OSABI] field isn't being set to ELFOSABI_NETBSD?

I believe that is intentional. Running the same command on NetBSD/amd64
gives the same output.

Running "man 5 elf" shows

         EI_OSABI       Contains the operating system ABI identifica-
                                 tion. Note that even though the definition
                                 ELFOSABI_NETBSD exists, NetBSD uses
                                 ELFOSABI_SYSV here, since the NetBSD ABI does
                                 not deviate from the standard.

The ELF binary can contain an ELF PT_NOTE to show that it's meant for NetBSD. See

https://www.netbsd.org/docs/kernel/elf-notes.html

> Thanks,
> Joseph Koshy
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.