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: Ondrej Bilka X-Patchwork-Id: 1089 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx21.g.dreamhost.com (peon2454.g.dreamhost.com [208.113.200.127]) by wilcox.dreamhost.com (Postfix) with ESMTP id D2D623600B4 for ; Fri, 23 May 2014 02:42:11 -0700 (PDT) Received: by homiemail-mx21.g.dreamhost.com (Postfix, from userid 14307373) id 1B4E01A01671; Fri, 23 May 2014 02:42:10 -0700 (PDT) X-Original-To: glibc@patchwork.siddhesh.in Delivered-To: x14307373@homiemail-mx21.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-mx21.g.dreamhost.com (Postfix) with ESMTPS id 400171A02625 for ; Fri, 23 May 2014 02:42:10 -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=E015+oiaiOmdioLO2hqMChjPaEJjOb drQR37DYo6swCaQBOlICH2Wi48ifj1nUoON/H58NI2hQMHSIvlx4KK9E9Z78iOdd Gn2L9zAM9wqe4SK+gTTNPZ8wUG3/5+3X1wyXewPafRDE3Pjw0mrLQSfb5ZlWAC7A cWzpwbNKThpZk= 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=MupH T7EiG7yolm/c3z5XWarmEeDTCZ6BxIPUNM75C8UwsOSlQpHm9I350hc3dFyEjseK DWJrV8YBlZq3UvTza2eXR4D9mIbuXcgnp+zqdtxMWCnhCpgiDs50tbNu8Djwz749 x1gBJAeQe57cL/awg2DTVZ5TSSqldCTnHK05c9g= 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) X-DH-Original-To: glibc@patchwork.siddhesh.in 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)