From patchwork Fri May 23 13:01:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ondrej Bilka X-Patchwork-Id: 1090 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx22.g.dreamhost.com (mx2.sub5.homie.mail.dreamhost.com [208.113.200.128]) by wilcox.dreamhost.com (Postfix) with ESMTP id 05E83360076 for ; Fri, 23 May 2014 06:01:27 -0700 (PDT) Received: by homiemail-mx22.g.dreamhost.com (Postfix, from userid 14307373) id A8FAB5D2BA47; Fri, 23 May 2014 06:01:27 -0700 (PDT) X-Original-To: glibc@patchwork.siddhesh.in Delivered-To: x14307373@homiemail-mx22.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx22.g.dreamhost.com (Postfix) with ESMTPS id 527B55D2BA43 for ; Fri, 23 May 2014 06:01:27 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-transfer-encoding :in-reply-to; q=dns; s=default; b=T4fxWhF34drgB44ZqNL7ynzfKcBSqm ZO1Zfh6cGZNUsVxKkX7QOEcLBE/Rd6EvzwGC9Sd8WDQ6gKnpv2ZJd7YYt3O4Jr55 o++LP+gjOuglgrubwTSzuL9AzjyXhZAi9Dltr/cla6RTPywmfvAqMH+T+WEDJ6xa YwCi4ikDsSZyE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-transfer-encoding :in-reply-to; s=default; bh=SQrdzlP9bEcKI7Je4SVyajPoKx4=; b=JDxp 0faVGMrrRzkRVsxPgseEYmK0/jRLfbi8G5TKxU7JdOGAT37gFk0NoV/qyfjtPC+v e4RUSRqrRxvgaKqoi+mRl1vg0/KZvAuAbLDeylXIf1dqbQ7jTavXiq2EuYdyZp9/ OBGVBeW1WZLabpfPHra5PfcnRd9uvIlVc0dxVbE= Received: (qmail 14292 invoked by alias); 23 May 2014 13:01:25 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 14274 invoked by uid 89); 23 May 2014 13:01:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.7 required=5.0 tests=AWL, BAYES_50, FREEMAIL_FROM, SPF_NEUTRAL autolearn=no version=3.3.2 X-HELO: popelka.ms.mff.cuni.cz Date: Fri, 23 May 2014 15:01:01 +0200 From: =?utf-8?B?T25kxZllaiBCw61sa2E=?= To: Andreas Schwab Cc: libc-alpha@sourceware.org Subject: [PATCH v1.2] Remove duplicate code in elf/dl-deps.c Message-ID: <20140523130101.GA10153@domone.podge> References: <20140519094412.GA18336@domone.podge> <20140523094200.GA15064@domone.podge> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20140523094200.GA15064@domone.podge> User-Agent: Mutt/1.5.20 (2009-06-14) X-DH-Original-To: glibc@patchwork.siddhesh.in On Fri, May 23, 2014 at 11:42:01AM +0200, Ondřej Bílka wrote: > On Mon, May 19, 2014 at 12:47:14PM +0200, Andreas Schwab wrote: > > Ondřej Bílka writes: > > > > > - /* For filter objects the dependency must be available. */ > > > > Please keep the comment. > > > Fixed, ok now? > This one, somewhat I send variant that does not set err variable. * elf/dl-deps.c (_dl_map_object_deps): Remove duplicate code. diff --git a/elf/dl-deps.c b/elf/dl-deps.c index 9c83c81..c3b0cfc 100644 --- a/elf/dl-deps.c +++ b/elf/dl-deps.c @@ -302,22 +302,24 @@ _dl_map_object_deps (struct link_map *map, /* Store the tag in the argument structure. */ args.name = name; - if (d->d_tag == DT_AUXILIARY) + /* Say that we are about to load an auxiliary library. */ + if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS, + 0)) + _dl_debug_printf ("load auxiliary object=%s" + " requested by file=%s\n", + name, + DSO_FILENAME (l->l_name)); + + /* We must be prepared that the addressed shared + object is not available. For filter objects the dependency + must be available. */ + bool malloced; + int err = _dl_catch_error (&objname, &errstring, &malloced, + openaux, &args); + + if (__glibc_unlikely (errstring != NULL)) { - /* Say that we are about to load an auxiliary library. */ - if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS, - 0)) - _dl_debug_printf ("load auxiliary object=%s" - " requested by file=%s\n", - name, - DSO_FILENAME (l->l_name)); - - /* We must be prepared that the addressed shared - object is not available. */ - bool malloced; - (void) _dl_catch_error (&objname, &errstring, &malloced, - openaux, &args); - if (__glibc_unlikely (errstring != NULL)) + if (d->d_tag == DT_AUXILIARY) { /* We are not interested in the error message. */ assert (errstring != NULL); @@ -327,23 +329,9 @@ _dl_map_object_deps (struct link_map *map, /* Simply ignore this error and continue the work. */ continue; } - } - else - { - /* Say that we are about to load an auxiliary library. */ - if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS, - 0)) - _dl_debug_printf ("load filtered object=%s" - " requested by file=%s\n", - name, - DSO_FILENAME (l->l_name)); - - /* For filter objects the dependency must be available. */ - bool malloced; - int err = _dl_catch_error (&objname, &errstring, &malloced, - openaux, &args); - if (__glibc_unlikely (errstring != NULL)) + else { + char *new_errstring = strdupa (errstring); objname = strdupa (objname); if (malloced)