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: =?utf-8?b?T25kxZllaiBCw61sa2E=?= X-Patchwork-Id: 351840 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 A95A1140079 for ; Fri, 23 May 2014 23:01:30 +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=IgoWvroBzzRTExNkctskBbJ8GBy1wt f0EcDgJS3D1dj0fAAf09wcQKNZ++eICS2V2VTzkBa5t3F+U5bJjtIlUL22SpErbs dnQM7TIcAMtM1vjYI4mK6JoHj7Y0kxCKtF+uS7FEYzBW6CH9PiY4XkHs8/j5dIoi 1ZhPE0MOjnCcI= 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=tbh6 hTndcRWTmJPps0hGi5A0WJDqiE0MBCsciFo/INsA1B/WKsuswYtzVDJ08qqNL/KS CkxLh53W8PM17MQ1y2CeBhJYYJq2ka1cbn7Z4yu6QDAHBWDPOgVcmPgLLYvw6Cra LnKavUN7M+vmU0h5KOtSkamUMH99PkDicdGXymQ= 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) 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)