From patchwork Tue Jul 1 00:18:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyle McMartin X-Patchwork-Id: 32822 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f70.google.com (mail-oa0-f70.google.com [209.85.219.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 30955203C0 for ; Tue, 1 Jul 2014 00:18:28 +0000 (UTC) Received: by mail-oa0-f70.google.com with SMTP id m1sf56924671oag.5 for ; Mon, 30 Jun 2014 17:18:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mailing-list:precedence:list-id :list-unsubscribe:list-subscribe:list-archive:list-post:list-help :sender:delivered-to:date:from:to:cc:subject:message-id:mime-version :in-reply-to:user-agent:x-original-sender :x-original-authentication-results:content-type:content-disposition; bh=Be41WdmhkXLAuogQU1gpivb+tTlrtPjdlOh7aZa6l/4=; b=fIfT4WWnE8c+FUQ187RMj1BrxmX+lA2S4sDp5O3vZfP+0PhTvaT4RrEMmpkMm+7n3I Vje62RA8sJ68UWJq8/mKan1FTbBqT3FJ2H1i2noVNRJBeWrDCoSXj+R26kAfW0PpusIz 5hjyMwwQnWNM3MKuOdzspY1Z1mTVZxdfn3v5NDZ3nFXvMYu+ZspSYdSpNDFvhR2a7h/A V7NwOgjcB3RQ3ggd0ZjKMKOVOvDyO5BGcNbd9V7YpYxibJwqkO6440uAt/yV9OS6Ncgn 42XmYNEkUMgIQDqK17KHmFI6xxB9vsctwplPyusSW6hjKLtdvRuQOdoLYD9jYWZ6j9H5 z64Q== X-Gm-Message-State: ALoCoQk3PAcxt4jdaG+Ya1GITq9H43m0bAsCshCR4oinMBqdUTyxOdtt9pQeocnfOPeNWbocWaQu X-Received: by 10.182.104.68 with SMTP id gc4mr21549808obb.40.1404173908206; Mon, 30 Jun 2014 17:18:28 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.80.114 with SMTP id b105ls1750881qgd.16.gmail; Mon, 30 Jun 2014 17:18:28 -0700 (PDT) X-Received: by 10.58.29.164 with SMTP id l4mr40565152veh.8.1404173908071; Mon, 30 Jun 2014 17:18:28 -0700 (PDT) Received: from mail-vc0-x229.google.com (mail-vc0-x229.google.com [2607:f8b0:400c:c03::229]) by mx.google.com with ESMTPS id wy3si10766075vec.80.2014.06.30.17.18.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 30 Jun 2014 17:18:28 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c03::229 as permitted sender) client-ip=2607:f8b0:400c:c03::229; Received: by mail-vc0-f169.google.com with SMTP id la4so8432904vcb.0 for ; Mon, 30 Jun 2014 17:18:28 -0700 (PDT) X-Received: by 10.221.44.73 with SMTP id uf9mr41420956vcb.9.1404173907969; Mon, 30 Jun 2014 17:18:27 -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 tc5csp177715vcb; Mon, 30 Jun 2014 17:18:27 -0700 (PDT) X-Received: by 10.66.255.67 with SMTP id ao3mr55818151pad.25.1404173907184; Mon, 30 Jun 2014 17:18:27 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id sj7si24967460pbc.44.2014.06.30.17.18.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Jun 2014 17:18:27 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-return-84144-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 3232 invoked by alias); 1 Jul 2014 00:18:14 -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: binutils-owner@sourceware.org Delivered-To: mailing list binutils@sourceware.org Received: (qmail 3215 invoked by uid 89); 1 Jul 2014 00:18:13 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 01 Jul 2014 00:18:13 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s610IARH004916 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 30 Jun 2014 20:18:10 -0400 Received: from redacted.bos.redhat.com ([10.18.17.143]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s610I8Bg020829 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Mon, 30 Jun 2014 20:18:10 -0400 Date: Mon, 30 Jun 2014 20:18:08 -0400 From: Kyle McMartin To: binutils@sourceware.org Cc: will.newton@linaro.org, nickc@redhat.com Subject: [PATCH 2/2] bfd/elfnn-aarch64.c: set DF_STATIC_TLS when emitting IE relocs Message-ID: <20140701001808.GB9511@redacted.bos.redhat.com> MIME-Version: 1.0 In-Reply-To: <20140512171906.GA21081@redacted.bos.redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-Original-Sender: kmcmarti@redhat.com 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:c03::229 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@sourceware.org X-Google-Group-Id: 836684582541 Content-Disposition: inline For consistency with other architectures, set DF_STATIC_TLS in shared libraries which will consume static TLS slots when loaded. Fixes the tls-flag-static_tls test added in 1/2. bfd/ChangeLog: 2014-06-30 Kyle McMartin * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Set DF_STATIC_TLS when emitting initial-exec relocs and not linking an executable. --- a/bfd/elfnn-aarch64.c +++ b/bfd/elfnn-aarch64.c @@ -5233,6 +5233,9 @@ elfNN_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info, got_type = aarch64_reloc_got_type (bfd_r_type); + if (!info->executable && (got_type & GOT_TLS_IE)) + info->flags |= DF_STATIC_TLS; + if (h) { h->got.refcount += 1;