|Version 4 (modified by jkoshy, 2 years ago)|
Incompatibility with Red Hat Elfutils
elf_getshnum(), elf_getshstrndx() return value
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.
Status of Proposed Fixes/Workarounds
- (2009/Jun/03) Ali.Bahrami@… 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 .