From sacadmin Tue Aug 21 14:28:30 2007
Received: from sfbaymail2sca.sfbay.sun.com (sfbaymail2sca [129.145.155.42])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id l7LLSU6L014792
	for <psarc-record@sac.sfbay.sun.com>; Tue, 21 Aug 2007 14:28:30 -0700 (PDT)
Received: from sca-es-mail-1.sun.com (sca-es-mail-1.Sun.COM [192.18.43.132])
	by sfbaymail2sca.sfbay.sun.com (8.13.6+Sun/8.12.10/ENSMAIL,v2.2) with ESMTP id l7LLPv38000107
	for <psarc-record@sac.sfbay.sun.com>; Tue, 21 Aug 2007 14:25:57 -0700 (PDT)
Received: from fe-sfbay-09.sun.com ([192.18.43.129])
	by sca-es-mail-1.sun.com (8.13.7+Sun/8.12.9) with ESMTP id l7LLPqdm001964
	for <psarc-record@sac.sfbay.sun.com>; Tue, 21 Aug 2007 14:25:52 -0700 (PDT)
Received: from conversion-daemon.fe-sfbay-09.sun.com by fe-sfbay-09.sun.com
 (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007))
 id <0JN500C01777QY00@fe-sfbay-09.sun.com>
 (original mail from John.Plocher@Sun.COM) for psarc-record@sac.sfbay.sun.com;
 Tue, 21 Aug 2007 14:25:52 -0700 (PDT)
Received: from [129.146.58.87] by fe-sfbay-09.sun.com
 (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007))
 with ESMTPSA id <0JN50091R7IWF830@fe-sfbay-09.sun.com> for
 psarc-record@sac.sfbay.sun.com; Tue, 21 Aug 2007 14:25:45 -0700 (PDT)
Date: Tue, 21 Aug 2007 14:25:39 -0700
From: John Plocher <John.Plocher@Sun.COM>
Subject: [Fwd: sacMaiL Error [PSARC]: 2007/474: new ldd(1) -w option]
Sender: John.Plocher@Sun.COM
To: psarc-record@sac.sfbay.sun.com
Message-id: <46CB5853.4030900@Sun.Com>
MIME-version: 1.0
Content-type: text/plain; format=flowed; charset=ISO-8859-1
Content-transfer-encoding: 7BIT
User-Agent: Thunderbird 1.5.0.12 (Macintosh/20070509)
Status: RO
Content-Length: 5390



-------- Original Message --------
Subject: sacMaiL Error [PSARC]: 2007/474: new ldd(1) -w option
Date: Tue, 21 Aug 2007 14:15:53 -0700 (PDT)
From: Sac Administrator <sacadmin@sac.sfbay.sun.com>
To: undisclosed-recipients: ;


[This message was auto-generated by the SAC mail system]

NOT SAVED: /export/sac/Archives/CaseLog/arc/PSARC/2007/474/mail
     This message was not saved in the project's mail log.
     This may be because of file permission problems:
     -rw-rw-r--   1 rie      staff          0 Aug 21 14:13 /export/sac/Archives/CaseLog/arc/PSARC/2007/474/mail

     Please contact SACAdmin@sac.sfbay about this problem.

---- original message follows ----

Date: Tue, 21 Aug 2007 14:10:35 -0700
From: Rod Evans <Rod.Evans@sun.com>
To: psarc@sac.sfbay.sun.com
Subject: 2007/474: new ldd(1) -w option
Content-Type: text/plain; charset=ISO-8859-1; format=flowed


I'm sponsoring the following case for myself.   This case qualifies for
Architectural self-review, but I wish to record the following
information.

------------------------------------------------------------------------

6594430/6595139 uncovered an issue where too many symbols had been
reduced to locals within an application.  This application, built with
lex(1), should export a number of "yy*" interfaces so that libl.so
can reference these entry points.  However, the references in libl.so
are all defined weak, and an unresolved weak reference results in no
relocation error, and the value zero being written to the relocation
offset.

Bottom line, the lack of the required call back interfaces isn't being
discovered by any tools we presently use to inspect binaries:

    oxpoly 432. ldd /usr/bin/genmsg
          libl.so.1 =>     /usr/lib/libl.so.1
          libc.so.1 =>     /lib/libc.so.1
          libm.so.2 =>     /lib/libm.so.2
          /platform/SUNW,Sun-Blade-1000/lib/libc_psr.so.1

------------------------------------------------------------------------

This fast track introduced a new, -w, option to ldd(1):

    User Commands                                              ldd(1)

    SYNOPSIS
       ldd [-d | -r] [-c] [-e envar] [-f] [-i] [-L] [-l] [-s]
            [-U | -u] [-v] [-w] filename...                             |

       ...

       ldd can also check the compatibility of  filename  with  the
       shared  objects  filename  uses.  With each of the following
       options, ldd  prints  warnings  for  any  unresolved  symbol
       references that would occur when filename is loaded.

       -d   Check immediate references.

       -r   Check both immediate references and lazy references.

       -w   Check for any unresolved weak symbol references.            |

       Only one of the options -d or -r  can  be  specified  during
       any single invocation of ldd.  The -w option can be combined     |
       with either the -d option or the -r option.                      |

       ...

       Symbols that are used by relocations may be defined as  weak     |
       references.  By  default, if a weak symbol reference can not     |
       be resolved, the relocation is ignored and a zero written to     |
       the relocation offset.  The -w, when used with either the -d     |
       or the -r options, causes any unresolved relocation  against     |
       a weak symbol reference to be flagged as a relocation error.     |


With this option we can now observe unresolved weak references:

    oxpoly 434. ldd -rw /usr/bin/genmsg
          libl.so.1 =>     /usr/lib/libl.so.1
          libc.so.1 =>     /lib/libc.so.1
          symbol not found: __1cG__CrunMdo_exit_code6F_v_  (/usr/bin/genmsg)
          /platform/SUNW,Sun-Blade-1000/lib/libc_psr.so.1
          symbol not found: yyout         (/usr/lib/libl.so.1)
          symbol not found: yyleng                (/usr/lib/libl.so.1)
          symbol not found: yytext                (/usr/lib/libl.so.1)
          symbol not found: yyfnd         (/usr/lib/libl.so.1)
          symbol not found: yyprevious            (/usr/lib/libl.so.1)
          symbol not found: yyextra               (/usr/lib/libl.so.1)
          symbol not found: yylsp         (/usr/lib/libl.so.1)
          symbol not found: yylstate              (/usr/lib/libl.so.1)
          symbol not found: yyolsp                (/usr/lib/libl.so.1)
          symbol not found: yywleng               (/usr/lib/libl.so.1)
          symbol not found: yywtext               (/usr/lib/libl.so.1)
          symbol not found: yylex         (/usr/lib/libl.so.1)
          symbol not found: yyinput               (/usr/lib/libl.so.1)
          symbol not found: yyunput               (/usr/lib/libl.so.1)
          symbol not found: yyback                (/usr/lib/libl.so.1)
          symbol not found: yywinput              (/usr/lib/libl.so.1)
          symbol not found: yywunput              (/usr/lib/libl.so.1)
          symbol not found: __tnf_probe_notify    (/lib/libc.so.1)
          symbol not found: __tnf_probe_notify    (/lib/libc.so.1)
          libm.so.2 =>     /lib/libm.so.2

Note, this option is also catching the weak reference of
__Crun::do_exit_code() is the included crt, and thw two tnf
references from libc.

-----------------------------------------------------------------------

Release Binding:               Patch/Micro
ldd -w option                  Committed

-- 

Rod.
---- end of original message ----



From Rod.Evans@sun.com Tue Aug 21 15:12:15 2007
Received: from jurassic-x4600.sfbay.sun.com (cretaceous [129.146.17.63])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id l7LMCFr3016796
	for <psarc-ext@sac.sfbay.sun.com>; Tue, 21 Aug 2007 15:12:15 -0700 (PDT)
Received: from [129.146.228.120] (chaz.SFBay.Sun.COM [129.146.228.120])
	by jurassic-x4600.sfbay.sun.com (8.14.1+Sun/8.14.1) with ESMTP id l7LM9g7H108801
	for <psarc-ext@sac.sfbay.sun.com>; Tue, 21 Aug 2007 15:09:42 -0700 (PDT)
Message-ID: <46CB6203.5060001@sun.com>
Date: Tue, 21 Aug 2007 15:06:59 -0700
From: Rod Evans <Rod.Evans@sun.com>
Reply-To: Rod.Evans@sun.com
Organization: Sun Microsystems Inc.
User-Agent: Thunderbird 2.0.0.4 (X11/20070703)
MIME-Version: 1.0
To: psarc-ext@sac.sfbay.sun.com
Subject: 2007/474: new ldd(1) -w option
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Status: RO
Content-Length: 4427


I'm sponsoring the following case for myself.   This case qualifies for
Architectural self-review, but I wish to record the following
information.

------------------------------------------------------------------------

6594430/6595139 uncovered an issue where too many symbols had been
reduced to locals within an application.  This application, built with
lex(1), should export a number of "yy*" interfaces so that libl.so
can reference these entry points.  However, the references in libl.so
are all defined weak, and an unresolved weak reference results in no
relocation error, and the value zero being written to the relocation
offset.

Bottom line, the lack of the required call back interfaces isn't being
discovered by any tools we presently use to inspect binaries:

   oxpoly 432. ldd /usr/bin/genmsg
         libl.so.1 =>     /usr/lib/libl.so.1
         libc.so.1 =>     /lib/libc.so.1
         libm.so.2 =>     /lib/libm.so.2
         /platform/SUNW,Sun-Blade-1000/lib/libc_psr.so.1

------------------------------------------------------------------------

This fast track introduced a new, -w, option to ldd(1):

   User Commands                                              ldd(1)

   SYNOPSIS
      ldd [-d | -r] [-c] [-e envar] [-f] [-i] [-L] [-l] [-s]
           [-U | -u] [-v] [-w] filename...                             |

      ...

      ldd can also check the compatibility of  filename  with  the
      shared  objects  filename  uses.  With each of the following
      options, ldd  prints  warnings  for  any  unresolved  symbol
      references that would occur when filename is loaded.

      -d   Check immediate references.

      -r   Check both immediate references and lazy references.

      -w   Check for any unresolved weak symbol references.            |

      Only one of the options -d or -r  can  be  specified  during
      any single invocation of ldd.  The -w option can be combined     |
      with either the -d option or the -r option.                      |

      ...

      Symbols that are used by relocations may be defined as  weak     |
      references.  By  default, if a weak symbol reference can not     |
      be resolved, the relocation is ignored and a zero written to     |
      the relocation offset.  The -w, when used with either the -d     |
      or the -r options, causes any unresolved relocation  against     |
      a weak symbol reference to be flagged as a relocation error.     |


With this option we can now observe unresolved weak references:

   oxpoly 434. ldd -rw /usr/bin/genmsg
         libl.so.1 =>     /usr/lib/libl.so.1
         libc.so.1 =>     /lib/libc.so.1
         symbol not found: __1cG__CrunMdo_exit_code6F_v_  (/usr/bin/genmsg)
         /platform/SUNW,Sun-Blade-1000/lib/libc_psr.so.1
         symbol not found: yyout         (/usr/lib/libl.so.1)
         symbol not found: yyleng                (/usr/lib/libl.so.1)
         symbol not found: yytext                (/usr/lib/libl.so.1)
         symbol not found: yyfnd         (/usr/lib/libl.so.1)
         symbol not found: yyprevious            (/usr/lib/libl.so.1)
         symbol not found: yyextra               (/usr/lib/libl.so.1)
         symbol not found: yylsp         (/usr/lib/libl.so.1)
         symbol not found: yylstate              (/usr/lib/libl.so.1)
         symbol not found: yyolsp                (/usr/lib/libl.so.1)
         symbol not found: yywleng               (/usr/lib/libl.so.1)
         symbol not found: yywtext               (/usr/lib/libl.so.1)
         symbol not found: yylex         (/usr/lib/libl.so.1)
         symbol not found: yyinput               (/usr/lib/libl.so.1)
         symbol not found: yyunput               (/usr/lib/libl.so.1)
         symbol not found: yyback                (/usr/lib/libl.so.1)
         symbol not found: yywinput              (/usr/lib/libl.so.1)
         symbol not found: yywunput              (/usr/lib/libl.so.1)
         symbol not found: __tnf_probe_notify    (/lib/libc.so.1)
         symbol not found: __tnf_probe_notify    (/lib/libc.so.1)
         libm.so.2 =>     /lib/libm.so.2

Note, this option is also catching the weak reference of
__Crun::do_exit_code() is the included crt, and thw two tnf
references from libc.

-----------------------------------------------------------------------

Release Binding:               Patch/Micro
ldd -w option                  Committed

-- 

Rod.


