From patchwork Mon May 12 17:19:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyle McMartin X-Patchwork-Id: 29983 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f197.google.com (mail-ig0-f197.google.com [209.85.213.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2B56E238EB for ; Mon, 12 May 2014 17:19:30 +0000 (UTC) Received: by mail-ig0-f197.google.com with SMTP id hn18sf13826190igb.8 for ; Mon, 12 May 2014 10:19:29 -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:subject:message-id:mime-version :user-agent:x-original-sender:x-original-authentication-results :content-type:content-disposition; bh=nkMeYI6eKG4sgalspaal0Px+a4UgcOZM233Kzv1Z4go=; b=eOeOE7ULqffleI64U8VgdpgVHENsjS1d7cvFz9Sj/oHabdPh2kSP+XbSX8nQjeLRI8 HYQ0bUnWVXnOa9V1/McDXaiUWhzaF7EpARXTrrRTf67WFu3DXsiDB5MrAFgYxHsVzAUM Gcxn/JYYUbJ+wDkaArPwJbmanvlpbt+ezHqDLMb7Ao9fwzo0kENZCFvN2LddrESYz0R9 Cq67LkfgjB3uk2MrsWWjb3kCJ9Dd9yB3SbjKWIXVXXlwmxH/6hNu5g31obBFioMpyhoE uX8oJc7fEMzsd5vb/DLnd/iMia8VNPqYc6lqJYHwSvLEUzq6beGP1wr/DSihPCp9bJjt DkZw== X-Gm-Message-State: ALoCoQks3WcgsM+eOEEH/0u8L4VFBi4ELsCEgUnDVq45PDW0EBa+G5Rv18wi3oLPlzHIdD4Wdrbw X-Received: by 10.43.92.68 with SMTP id bp4mr13007944icc.26.1399915169397; Mon, 12 May 2014 10:19:29 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.33.164 with SMTP id j33ls1536753qgj.73.gmail; Mon, 12 May 2014 10:19:29 -0700 (PDT) X-Received: by 10.58.23.6 with SMTP id i6mr24046953vef.12.1399915169260; Mon, 12 May 2014 10:19:29 -0700 (PDT) Received: from mail-ve0-x230.google.com (mail-ve0-x230.google.com [2607:f8b0:400c:c01::230]) by mx.google.com with ESMTPS id sg6si2170929vdc.117.2014.05.12.10.19.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 May 2014 10:19:29 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c01::230 as permitted sender) client-ip=2607:f8b0:400c:c01::230; Received: by mail-ve0-f176.google.com with SMTP id jz11so9091079veb.7 for ; Mon, 12 May 2014 10:19:29 -0700 (PDT) X-Received: by 10.58.116.175 with SMTP id jx15mr24283817veb.9.1399915169190; Mon, 12 May 2014 10:19:29 -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.220.221.72 with SMTP id ib8csp86291vcb; Mon, 12 May 2014 10:19:28 -0700 (PDT) X-Received: by 10.182.231.138 with SMTP id tg10mr36126700obc.44.1399915168616; Mon, 12 May 2014 10:19:28 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id dg5si6654697pbc.265.2014.05.12.10.19.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 May 2014 10:19:28 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-return-83701-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 13166 invoked by alias); 12 May 2014 17:19:12 -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 13147 invoked by uid 89); 12 May 2014 17:19:10 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS 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 ESMTP; Mon, 12 May 2014 17:19:09 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s4CHJ8SE021175 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 12 May 2014 13:19:08 -0400 Received: from redacted.bos.redhat.com ([10.18.17.143]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s4CHJ68T010335 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Mon, 12 May 2014 13:19:08 -0400 Date: Mon, 12 May 2014 13:19:06 -0400 From: Kyle McMartin To: binutils@sourceware.org Subject: [PATCH][AARCH64] set DF_STATIC_TLS when emitting IE relocs Message-ID: <20140512171906.GA21081@redacted.bos.redhat.com> MIME-Version: 1.0 User-Agent: Mutt/1.5.21 (2010-09-15) 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:c01::230 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. 2014-05-12 Kyle McMartin * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Set DF_STATIC_TLS when emitting initial-exec relocs and not linking an executable. --- bfd/elfnn-aarch64.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c index 498b7bd..229407e 100644 --- a/bfd/elfnn-aarch64.c +++ b/bfd/elfnn-aarch64.c @@ -5272,6 +5272,9 @@ elfNN_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info, if ((got_type & GOT_TLS_IE) && GOT_TLS_GD_ANY_P (got_type)) got_type &= ~ (GOT_TLSDESC_GD | GOT_TLS_GD); + if (!info->executable && (got_type & GOT_TLS_IE)) + info->flags |= DF_STATIC_TLS; + if (old_got_type != got_type) { if (h != NULL)