From sacadmin Wed Jun 17 09:26:58 2009
Received: from sac.sfbay.sun.com (localhost [127.0.0.1])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n5HGQwPv014493;
	Wed, 17 Jun 2009 09:26:58 -0700 (PDT)
Received: (from ab196087@localhost)
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8/Submit) id n5HGQwJi014489;
	Wed, 17 Jun 2009 09:26:58 -0700 (PDT)
Date: Wed, 17 Jun 2009 09:26:58 -0700 (PDT)
From: Ali Bahrami <ab196087@sac.sfbay.sun.com>
Message-Id: <200906171626.n5HGQwJi014489@sac.sfbay.sun.com>
To: PSARC-record@sac.sfbay.sun.com
Subject: replace elf_getphnum, elf_getshnum, and elf_getshstrndx [PSARC/2009/363 Self Review]
Status: RO
Content-Length: 587


Template Version: @(#)sac_nextcase 1.68 02/23/09 SMI
This information is Copyright 2009 Sun Microsystems
1. Introduction
    1.1. Project/Component Working Name:
	 replace elf_getphnum, elf_getshnum, and elf_getshstrndx
    1.2. Name of Document Author/Supplier:
	 Author:  Ali Bahrami
    1.3  Date of This Document:
	17 June, 2009
4. Technical Description
    See the case directory for more detail

6. Resources and Schedule
    6.4. Steering Committee requested information
   	6.4.1. Consolidation C-team Name:
		on
    6.5. ARC review type: Automatic
    6.6. ARC Exposure: open


From Ali.Bahrami@sun.com Wed Jun 17 09:43:08 2009
Received: from sunmail5.uk.sun.com (sunmail5.UK.Sun.COM [129.156.85.165])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n5HGh8t9014644
	for <psarc-ext@sac.sfbay.sun.com>; Wed, 17 Jun 2009 09:43:08 -0700 (PDT)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by sunmail5.uk.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2) with ESMTP id n5HGgr14026862
	for <@sunmail2sca.sfbay.sun.com:psarc-ext@sun.com>; Wed, 17 Jun 2009 17:43:07 +0100 (BST)
Received: from pmxchannel-daemon.nwk-avmta-1.sfbay.Sun.COM by
 nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KLE0004T6FTQ000@nwk-avmta-1.sfbay.Sun.COM> for psarc-ext@sun.com
 (ORCPT psarc-ext@sun.com); Wed, 17 Jun 2009 09:43:05 -0700 (PDT)
Received: from brmea-mail-1.sun.com ([192.18.98.31])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KLE00BV86FRPQ80@nwk-avmta-1.sfbay.Sun.COM> for
 psarc-ext@sun.com (ORCPT psarc-ext@sun.com); Wed,
 17 Jun 2009 09:43:03 -0700 (PDT)
Received: from fe-amer-09.sun.com ([192.18.109.79])
	by brmea-mail-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id n5HGh3n5022189	for
 <psarc-ext@sun.com>; Wed, 17 Jun 2009 16:43:03 +0000 (GMT)
Received: from conversion-daemon.mail-amer.sun.com by mail-amer.sun.com
 (Sun Java(tm) System Messaging Server 7u2-7.02 64bit (built Apr 16 2009))
 id <0KLE00C005NJ0V00@mail-amer.sun.com> for psarc-ext@sun.com
 (ORCPT psarc-ext@sun.com); Wed, 17 Jun 2009 10:43:03 -0600 (MDT)
Received: from [172.20.25.67] ([unknown] [172.20.25.67])
 by mail-amer.sun.com (Sun Java(tm) System Messaging Server 7u2-7.02 64bit
 (built Apr 16 2009)) with ESMTPSA id <0KLE00JD06FQ5700@mail-amer.sun.com> for
 psarc-ext@sun.com (ORCPT psarc-ext@sun.com); Wed,
 17 Jun 2009 10:43:02 -0600 (MDT)
Date: Wed, 17 Jun 2009 10:41:20 -0600
From: Ali Bahrami <Ali.Bahrami@sun.com>
Subject: PSARC 2009/363 replace elf_getphnum, elf_getshnum, and elf_getshstrndx
Sender: Ali.Bahrami@sun.com
To: psarc-ext@sun.com
Message-id: <4A391CB0.6000006@Sun.COM>
MIME-version: 1.0
Content-type: text/plain; CHARSET=US-ASCII; format=flowed
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
User-Agent: Thunderbird 2.0.0.21 (X11/20090505)
Status: RO
Content-Length: 2796

I am sponsoring the following self-reviewed case for myself. I
believe these changes are sufficiently non-controversial, and
reflect a wider community agreement.

It obsoletes three existing functions in libelf, and adds
three new functions to replace them, as follows:

      Obsolete            Replaced By
     ---------------------------------------
       elf_getphnum()      elf_getphdrnum()
       elf_getshnum()      elf_getshdrnum()
       elf_getshstrndx()   elf_getshdrstrndx()

This action is being taken to address:

     6851224 elf_getshnum() and elf_getshstrndx() incompatible with
             2002 ELF gABI agreement

The original functions were defined at a meeting held in 2002 with
representatives from other ELF based systems. The agreement was that
they should return -1 for failure, and 0 for success. We originally
defined them that way

     4696204 enable extended section indexes in relocatable objects
     PSARC/2001/332 ELF gABI updates - round II

and our original manpages documented them as such. However, due to a
simple mistake, our implementation of these functions returns 0 for failure,
and 1 for success. In 2005, the discrepancy between documentation and
implementation was noted, and the documentation modified to match the code:

     6348820 elf_getident(3ELF) is inaccurate and lacks a RETURN VALUES section

I recently became aware of the deviation from the 2002 gABI agreement when
I received email about some ELF code I had posted to my Sun blog that did
not work properly under Linux. I have exchanged email with the maintainers
of other libelf implementations, and we have mutually agreed that the least
damaging way to repair this issue is to obsolete the original three
functions, and replace them with new versions that return -1 for failure,
and 0 for success.

Although the original functions will be obsoleted, there is no intent
to remove them. Each libelf implementation will retain them unchanged,
for binary compatibility with their respective installed bases. Manpages
and other documentation will make it clear that their use is discouraged,
and will point at the replacements.

The fix for 6851224 will include converting the OSnet code base to
use the new functions rather than the old versions. Existing code is
often used as a template for new code, so this change will help ensure
that the right versions are copied and used going forward.

-----

Release Binding:                        Patch/Micro

elf_getphnum()                          Obsolete Committed
elf_getshnum()                          Obsolete Committed
elf_getshdrnum()                        Obsolete Committed

elf_getphdrnum()                        Committed
elf_getshstrndx()                       Committed
elf_getshdrstrndx()                     Committed

From carlsonj@phorcys.east.sun.com Wed Jun 17 09:49:51 2009
Received: from sunmail5.uk.sun.com (sunmail5.UK.Sun.COM [129.156.85.165])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n5HGnpDD015057
	for <psarc-ext@sac.sfbay.sun.com>; Wed, 17 Jun 2009 09:49:51 -0700 (PDT)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by sunmail5.uk.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2) with ESMTP id n5HGngkh001369
	for <@sunmail2sca.sfbay.sun.com:psarc-ext@Sun.COM>; Wed, 17 Jun 2009 17:49:50 +0100 (BST)
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KLE00L0R6R0AF00@brm-avmta-1.central.sun.com> for psarc-ext@Sun.COM
 (ORCPT psarc-ext@Sun.COM); Wed, 17 Jun 2009 10:49:48 -0600 (MDT)
Received: from dm-east-01.east.sun.com ([129.148.9.192])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KLE00HL96QZ8330@brm-avmta-1.central.sun.com> for
 psarc-ext@Sun.COM (ORCPT psarc-ext@Sun.COM); Wed,
 17 Jun 2009 10:49:47 -0600 (MDT)
Received: from phorcys.east.sun.com (phorcys.East.Sun.COM [129.148.174.143])
	by dm-east-01.east.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2)
 with ESMTP id n5HGnlDK007505; Wed, 17 Jun 2009 12:49:47 -0400 (EDT)
Received: from phorcys.east.sun.com (phorcys.local [127.0.0.1])
	by phorcys.east.sun.com (8.14.3+Sun/8.14.3) with ESMTP id n5HGmSp5010002; Wed,
 17 Jun 2009 12:48:28 -0400 (EDT)
Received: (from carlsonj@localhost)
	by phorcys.east.sun.com (8.14.3+Sun/8.14.3/Submit) id n5HGmSfr009999; Wed,
 17 Jun 2009 12:48:28 -0400 (EDT)
Date: Wed, 17 Jun 2009 12:48:28 -0400
From: James Carlson <james.d.carlson@sun.com>
Subject: Re: PSARC 2009/363 replace elf_getphnum, elf_getshnum,
 and elf_getshstrndx
In-reply-to: <4A391CB0.6000006@Sun.COM>
To: Ali Bahrami <Ali.Bahrami@sun.com>
Cc: psarc-ext@sun.com
Message-id: <19001.7772.248625.627220@gargle.gargle.HOWL>
MIME-version: 1.0
X-Mailer: VM 7.01 under Emacs 21.3.1
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
References: <4A391CB0.6000006@Sun.COM>
Status: RO
Content-Length: 647

Ali Bahrami writes:
> Release Binding:                        Patch/Micro
> 
> elf_getphnum()                          Obsolete Committed
> elf_getshnum()                          Obsolete Committed
> elf_getshdrnum()                        Obsolete Committed
> 
> elf_getphdrnum()                        Committed
> elf_getshstrndx()                       Committed
> elf_getshdrstrndx()                     Committed

+1

-- 
James Carlson, Solaris Networking              <james.d.carlson@sun.com>
Sun Microsystems / 35 Network Drive        71.232W   Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757   42.496N   Fax +1 781 442 1677

