From patchwork Fri May 23 09:42:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?T25kxZllaiBCw61sa2E=?= X-Patchwork-Id: 351787 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 ozlabs.org (Postfix) with ESMTPS id D713B14007B for ; Fri, 23 May 2014 19:42:13 +1000 (EST) 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=F6mPpzpvrEcguewku9BxZ2RuwVGVL5 IlSI3JXUBjbsDL96xu2IxjH4cYQqi1mi5fAIpuVhCDyTabTqjIJoQU8+PMBEes+x uc1piT84nDHYFFOx7Ctn9OOdmwPBgMZ0LDBZJVsW4CJpmyHVuQPFmshTIgEQJ061 l3L1Qb4nVEm/E= 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=hpKShRFysIG36ThusLrDVVko0rI=; b=igsX UOZZ7Qtjx4LjVzDi6BzsNPdWgxTMQZkeHt9vuVbXQ0Xd2mCir0CoeEkkbcWddCBy Xf0awQXRfOuiqPPACzgTp73QJWU3h9g/+aq9UkZVi/850YwZNwvbI9adHakjXgqf sRwn50MbXmhTDlE+6kDyM+01bxA4kh+RGtKfWuw= Received: (qmail 7877 invoked by alias); 23 May 2014 09:42:08 -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 7867 invoked by uid 89); 23 May 2014 09:42:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.6 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, SPF_NEUTRAL autolearn=no version=3.3.2 X-HELO: popelka.ms.mff.cuni.cz Date: Fri, 23 May 2014 11:42:01 +0200 From: =?utf-8?B?T25kxZllaiBCw61sa2E=?= To: Andreas Schwab Cc: libc-alpha@sourceware.org Subject: Re: [PATCH v1.1] Remove duplicate code in elf/dl-deps.c Message-ID: <20140523094200.GA15064@domone.podge> References: <20140519094412.GA18336@domone.podge> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) 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? * 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..83cf497 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; + (void) _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)