From patchwork Mon Jul 7 14:20:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Newton X-Patchwork-Id: 33162 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f197.google.com (mail-qc0-f197.google.com [209.85.216.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BFD3E20969 for ; Mon, 7 Jul 2014 14:21:03 +0000 (UTC) Received: by mail-qc0-f197.google.com with SMTP id i8sf16229605qcq.8 for ; Mon, 07 Jul 2014 07:21:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:mailing-list :precedence:list-id:list-unsubscribe:list-subscribe:list-archive :list-post:list-help:sender:delivered-to:from:to:subject:date :message-id:x-original-sender:x-original-authentication-results; bh=uCb/zXBVl51px28ia+I7pCRkKLu1HmWROP7uaW2aB5s=; b=ckl9/2ugxiTWpfofQ4S7uVz42VwJk4UAS/XSD6OOeP1D8I2G7zGnHN+lXC6a+QYL0v RHdNnE8LImm8RU9CvypWUVs8DIGTKT75XJhB0hzVwNR2dxvHaBcvijjkyRaGGlDl/W+/ CZp7hUgSdZ1LagFb8Nu6EOSRT+bVGPCeYrPGgTIST2RuNiCRRmyDYzohPSvYLnc1i5wC 3eaKTJbyeApYhH5jmTSK4mZieWhKd/5YJReB+w0nqGjXE45zWCpkYaPvq+X61KVmaHpe fIGStRomTx9jRLMPH8CJq9/ovuyYjbXUx5LprLZBAPV6xsAy0kxYx5lNbLhiz59xwuZT hJtA== X-Gm-Message-State: ALoCoQmAwcJWOxpeRJtHvgk8Etrcn7wzrJCu84JCaciwtCSV7RVWeAacGDxgabOsYyUrVoJd4zu2 X-Received: by 10.236.171.234 with SMTP id r70mr12141143yhl.45.1404742863198; Mon, 07 Jul 2014 07:21:03 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.106.134 with SMTP id e6ls1795331qgf.34.gmail; Mon, 07 Jul 2014 07:21:03 -0700 (PDT) X-Received: by 10.58.40.75 with SMTP id v11mr404078vek.77.1404742863096; Mon, 07 Jul 2014 07:21:03 -0700 (PDT) Received: from mail-ve0-x236.google.com (mail-ve0-x236.google.com [2607:f8b0:400c:c01::236]) by mx.google.com with ESMTPS id br17si2849422veb.63.2014.07.07.07.21.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 07 Jul 2014 07:21:03 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c01::236 as permitted sender) client-ip=2607:f8b0:400c:c01::236; Received: by mail-ve0-f182.google.com with SMTP id oy12so4127087veb.13 for ; Mon, 07 Jul 2014 07:21:03 -0700 (PDT) X-Received: by 10.52.244.81 with SMTP id xe17mr23438187vdc.24.1404742863028; Mon, 07 Jul 2014 07:21:03 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp671118vcb; Mon, 7 Jul 2014 07:21:02 -0700 (PDT) X-Received: by 10.66.136.103 with SMTP id pz7mr1962547pab.140.1404742862168; Mon, 07 Jul 2014 07:21:02 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id x6si4907393pdl.191.2014.07.07.07.21.01 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Jul 2014 07:21:02 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-51569-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 17801 invoked by alias); 7 Jul 2014 14:20:51 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list 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 17681 invoked by uid 89); 7 Jul 2014 14:20:49 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wg0-f52.google.com X-Received: by 10.180.83.105 with SMTP id p9mr75792362wiy.8.1404742838031; Mon, 07 Jul 2014 07:20:38 -0700 (PDT) From: Will Newton To: libc-alpha@sourceware.org Subject: [PATCH] Fix -Wundef warnings for SHARED Date: Mon, 7 Jul 2014 15:20:32 +0100 Message-Id: <1404742832-25947-1-git-send-email-will.newton@linaro.org> X-Original-Sender: will.newton@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c01::236 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@sourceware.org X-Google-Group-Id: 836684582541 The definition of SHARED is tested with #ifdef pretty much everywhere apart from these few places. The tlsdesc.c code seems to be copy and pasted to a few architectures and there is one instance in the hppa startup code. ChangeLog: 2014-07-07 Will Newton * sysdeps/aarch64/tlsdesc.c (_dl_unmap): Test SHARED with #ifdef. * sysdeps/arm/tlsdesc.c (_dl_unmap): Likewise. * sysdeps/i386/tlsdesc.c (_dl_unmap): Likewise. * sysdeps/x86_64/tlsdesc.c (_dl_unmap): Likewise. * sysdeps/hppa/start.S (_start): Likewise. --- sysdeps/aarch64/tlsdesc.c | 2 +- sysdeps/arm/tlsdesc.c | 2 +- sysdeps/hppa/start.S | 2 +- sysdeps/i386/tlsdesc.c | 2 +- sysdeps/x86_64/tlsdesc.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sysdeps/aarch64/tlsdesc.c b/sysdeps/aarch64/tlsdesc.c index 1b41819..7e8cf65 100644 --- a/sysdeps/aarch64/tlsdesc.c +++ b/sysdeps/aarch64/tlsdesc.c @@ -147,7 +147,7 @@ _dl_unmap (struct link_map *map) { _dl_unmap_segments (map); -#if SHARED +#ifdef SHARED if (map->l_mach.tlsdesc_table) htab_delete (map->l_mach.tlsdesc_table); #endif diff --git a/sysdeps/arm/tlsdesc.c b/sysdeps/arm/tlsdesc.c index e52034d..ad74a23 100644 --- a/sysdeps/arm/tlsdesc.c +++ b/sysdeps/arm/tlsdesc.c @@ -149,7 +149,7 @@ _dl_unmap (struct link_map *map) { _dl_unmap_segments (map); -#if SHARED +#ifdef SHARED /* _dl_unmap is only called for dlopen()ed libraries, for which calling free() is safe, or before we've completed the initial relocation, in which case calling free() is probably pointless, diff --git a/sysdeps/hppa/start.S b/sysdeps/hppa/start.S index 0998270..7254a75 100644 --- a/sysdeps/hppa/start.S +++ b/sysdeps/hppa/start.S @@ -93,7 +93,7 @@ _start: stw %r23, -56(%sp) /* Need to setup 1, 4, 5, and 7th arguments */ -#if SHARED +#ifdef SHARED /* load main (1st argument) */ addil LT'.Lpmain, %r19 ldw RT'.Lpmain(%r1), %r26 diff --git a/sysdeps/i386/tlsdesc.c b/sysdeps/i386/tlsdesc.c index ef4a1dd..19a8788 100644 --- a/sysdeps/i386/tlsdesc.c +++ b/sysdeps/i386/tlsdesc.c @@ -261,7 +261,7 @@ _dl_unmap (struct link_map *map) { _dl_unmap_segments (map); -#if SHARED +#ifdef SHARED if (map->l_mach.tlsdesc_table) htab_delete (map->l_mach.tlsdesc_table); #endif diff --git a/sysdeps/x86_64/tlsdesc.c b/sysdeps/x86_64/tlsdesc.c index c1c5e03..451f7be 100644 --- a/sysdeps/x86_64/tlsdesc.c +++ b/sysdeps/x86_64/tlsdesc.c @@ -139,7 +139,7 @@ _dl_unmap (struct link_map *map) { _dl_unmap_segments (map); -#if SHARED +#ifdef SHARED /* _dl_unmap is only called for dlopen()ed libraries, for which calling free() is safe, or before we've completed the initial relocation, in which case calling free() is probably pointless,