From patchwork Mon May 19 09:44:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ondrej Bilka X-Patchwork-Id: 1007 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx23.g.dreamhost.com (mx2.sub5.homie.mail.dreamhost.com [208.113.200.128]) by wilcox.dreamhost.com (Postfix) with ESMTP id E07A73600C0 for ; Mon, 19 May 2014 02:44:21 -0700 (PDT) Received: by homiemail-mx23.g.dreamhost.com (Postfix, from userid 14307373) id 940F763AC3720; Mon, 19 May 2014 02:44:21 -0700 (PDT) X-Original-To: glibc@patchwork.siddhesh.in Delivered-To: x14307373@homiemail-mx23.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-mx23.g.dreamhost.com (Postfix) with ESMTPS id 7588563AC3717 for ; Mon, 19 May 2014 02:44:21 -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:subject:message-id:mime-version :content-type; q=dns; s=default; b=cMVxPs6MyKUJcg3/rAXNt3peW1Dw6 g9JNbEJVhcCZzXi4iriyHPy9LpT+Yv24v7S+tiVkk0xQxL2ydmS79vHfUIGu91M0 czZ+kMrPgL02D41vZ9wJ/cdlcNeHzLd5eo3fsBzvy8hHekDkwEVeSpR26teQ1W6V 2YD4cAjUV9mrx0= 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:subject:message-id:mime-version :content-type; s=default; bh=MMX7E8onMQ98VOuc8AXb0vi7bnw=; b=DuX 2aQ/+LHVVpK10FGkh5+jVgYOTE8JDVZ0cquzdk5hSa5KvUae9LhjPsvJsJRJYNc7 HogfZx8bodtAafzcIOQPRoR0pOmw9GIg2aqfLvaECpHe6OMfz9pFwToIQBklMtQk 4j7HZMgGUO9QwYM6HgUaySA7CUt3nP7Pg0qMLnkA= Received: (qmail 9969 invoked by alias); 19 May 2014 09:44:19 -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 9956 invoked by uid 89); 19 May 2014 09:44:18 -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: Mon, 19 May 2014 11:44:12 +0200 From: =?utf-8?B?T25kxZllaiBCw61sa2E=?= To: libc-alpha@sourceware.org Subject: [PATCH] Remove duplicate code in elf/dl-deps.c Message-ID: <20140519094412.GA18336@domone.podge> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-DH-Original-To: glibc@patchwork.siddhesh.in Hi, When looking for extend_alloca I found following duplicate condition. OK to commit? * 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..f3b0301 100644 --- a/elf/dl-deps.c +++ b/elf/dl-deps.c @@ -302,22 +301,23 @@ _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. */ + 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,22 +327,7 @@ _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);