Menu

LibElfIncompatibilityRedHatElfUtils

Joseph Koshy

Incompatibility with Red Hat Elfutils

1. (Resolved) elf_getshnum(), elf_getshstrndx() return value

Description

In our implementation of the ELF(3) API, functions elf_getshnum() and elf_getshstrndx() return zero in case of an error and non-zero in case of success. This behaviour is consistent with that of the ELF(3) implementations from the OpenSolaris and GNU projects.

In contrast, the similarly named functions in Red Hat elfutils return -1 in the case of an error and zero otherwise.

Resolution

New APIs elf_getshdrnum(), elf_getshdrstrndx(), and elf_getphdrnum() have been added to libelf.

Timeline of the proposed fixes/workarounds

  • (2009/Jun/03) Ali.Bahrami@sun.com suggests deprecating elf_getshnum(), elf_getshstrndx() and elf_getphnum() in favour of three new APIs elf_getshdrnum(), elf_getshdrstrndx(), and elf_getphdrnum() respectively. The new functions will return -1 in case of error, and zero otherwise.
  • (2009/Jun/15) See also: Solaris bug 6851224.
  • (2009/Jun/18) Per discussion on email with Ali Bahrami and Michael Riepe, Opensolaris's Nevada snv_118 build, RH Elfutils 0.142, and GNU libelf 0.8.12 will have the new APIs.
  • (2009/Aug/04) The three proposed APIs were added to libelf in changeset [r466]. These APIs will be present in the v0.5 and subsequent releases.

Related

Commit: [r466]
Wiki: Releases-Release0.5.1
Wiki: libelf

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.