From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3303 invoked by alias); 12 Aug 2017 22:06:11 -0000 Mailing-List: contact libc-stable-help@sourceware.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Subscribe: List-Archive: Sender: libc-stable-owner@sourceware.org Received: (qmail 3242 invoked by uid 89); 12 Aug 2017 22:06:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-27.3 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS,UNPARSEABLE_RELAY autolearn=ham version=3.3.2 spammy= X-Spam-Status: No, score=-27.3 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS,UNPARSEABLE_RELAY autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: torfep02.bell.net Received: from simcoe208srvr.owm.bell.net (HELO torfep02.bell.net) (184.150.200.208) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 12 Aug 2017 22:06:09 +0000 Received: from bell.net torfep02 184.150.200.158 by torfep02.bell.net with ESMTP id <20170812220607.SWAR2705.torfep02.bell.net@torspm02.bell.net> for ; Sat, 12 Aug 2017 18:06:07 -0400 Received: from [192.168.2.25] (really [174.91.88.229]) by torspm02.bell.net with ESMTP id <20170812220607.UGXB3378.torspm02.bell.net@[192.168.2.25]>; Sat, 12 Aug 2017 18:06:07 -0400 From: John David Anglin Content-Type: multipart/mixed; boundary=Apple-Mail-38-282357045 Date: Sun, 01 Jan 2017 00:00:00 -0000 Subject: [2.25 COMMITTED] hppa: Return to caller if dl_fixup fails to resolve callee on hppa To: Libc-stable Mailing List Message-Id: Mime-Version: 1.0 (Apple Message framework v1085) X-Mailer: Apple Mail (2.1085) X-Cloudmark-Analysis: v=2.2 cv=B59W6KlM c=1 sm=0 tr=0 a=oYUKPKGZpIz3GNhAIUXLSA==:17 a=KeKAF7QvOSUA:10 a=FBHGMhGWAAAA:8 a=8TYObpnUSsYZ2uA5JrUA:9 a=CjuIK1q_8ugA:10 a=ATlVsGG5QSsA:10 a=mDV3o1hIAAAA:8 a=gFKmuzOeH0lWj1sJMq4A:9 a=Ld372NDzu18A:10 a=9gvnlMMaQFpL9xblJ6ne:22 a=_FVE-zBwftR9WsbkzFJk:22 X-SW-Source: 2017-08/txt/msg00031.txt.bz2 --Apple-Mail-38-282357045 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Content-length: 128 This is commit 1903b38c6599129d9c09d5cffc9ca7cbeb50b100 with revised comment. Dave -- John David Anglin dave.anglin@bell.net --Apple-Mail-38-282357045 Content-Disposition: attachment; filename=dl-trampoline-v3-v2.25.d.txt Content-Type: text/plain; name="dl-trampoline-v3-v2.25.d.txt" Content-Transfer-Encoding: 7bit Content-length: 1666 2017-08-12 John David Anglin [BZ 19170] * sysdeps/hppa/dl-trampoline.S (_dl_runtime_resolve): Return to caller if _dl_fixup fails. diff --git a/sysdeps/hppa/dl-trampoline.S b/sysdeps/hppa/dl-trampoline.S index 856339bffe..3165c6f0e2 100644 --- a/sysdeps/hppa/dl-trampoline.S +++ b/sysdeps/hppa/dl-trampoline.S @@ -82,6 +82,21 @@ _dl_runtime_resolve: bl _dl_fixup,%rp copy %r21,%r19 /* set fixup func ltp */ + /* While the linker will set a function pointer to NULL when it + encounters an undefined weak function, we need to dynamically + detect removed weak functions. The issue arises because a weak + __gmon_start__ function was added to shared executables to work + around issues in _init that are now resolved. The presence of + __gmon_start__ in every shared library breaks the linker + `--as-needed' option. This __gmon_start__ function does nothing + but removal is tricky. Depending on the binding, removal can + cause an application using it to fault. The call to _dl_fixup + returns NULL when a function isn't resolved. In order to help + with __gmon_start__ removal, we return directly to the caller + when _dl_fixup returns NULL. This check could be removed when + BZ 19170 is fixed. */ + comib,= 0,%r28,1f + /* Load up the returned func descriptor */ copy %r28, %r22 copy %r29, %r19 @@ -107,6 +122,13 @@ _dl_runtime_resolve: /* Jump to new function, but return to previous function */ bv %r0(%r22) ldw -20(%sp),%rp + +1: + /* Return to previous function */ + ldw -148(%sp),%rp + bv %r0(%rp) + ldo -128(%sp),%sp + .EXIT .PROCEND cfi_endproc --Apple-Mail-38-282357045--