From patchwork Tue Jul 1 00:15:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyle McMartin X-Patchwork-Id: 32821 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f198.google.com (mail-yk0-f198.google.com [209.85.160.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C2A95203C0 for ; Tue, 1 Jul 2014 00:16:00 +0000 (UTC) Received: by mail-yk0-f198.google.com with SMTP id 9sf14448381ykp.9 for ; Mon, 30 Jun 2014 17:16:00 -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=Hv8l1mvd2KZSeXDCTjijG6gt5Bzn1inqSBetUUs/PSM=; b=aBQhfq9BknENRRn1ngTCGdrRgE8tFj4TQx5NKP3ha6gbhX/dw9NxfsHucozXUEz1/j Xrn6f/iRLOvypybIvdXuDVPSkGhzYPnOBjaIYIKfjbMcTU8upbZmTTKG2ZJlx8KYZAJ7 i2aTnyMu38PhsArdGY19prfOtI4z+xqimL2Vk3w27xx/EUzrWAR7zc9uA9jfVoJH5dVB x2Mpi4O2KwqIC/49uI+Ln1IjY9exQ0ZhcMtF3AfSzN3gGKyCywWrNn4WO6mcagoHGk70 VD+UnIdUNzj+LHjB0vnXpwpMbg3rPrnsXosi7b3U7mTNiUAxhGBE33Nye+9fIlxL77tr CxMg== X-Gm-Message-State: ALoCoQmalR2XUdEumojVFeWOfFyJcZbJ5d/EUhVEEMJXiRrRl8l8KPY60P0jtsyYGS8Cu8IToh2T X-Received: by 10.236.29.37 with SMTP id h25mr1969669yha.8.1404173760601; Mon, 30 Jun 2014 17:16:00 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.81.39 with SMTP id e36ls1607921qgd.24.gmail; Mon, 30 Jun 2014 17:16:00 -0700 (PDT) X-Received: by 10.220.69.72 with SMTP id y8mr41186386vci.21.1404173760321; Mon, 30 Jun 2014 17:16:00 -0700 (PDT) Received: from mail-ve0-x22c.google.com (mail-ve0-x22c.google.com [2607:f8b0:400c:c01::22c]) by mx.google.com with ESMTPS id u8si10757739vey.74.2014.06.30.17.16.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 30 Jun 2014 17:16:00 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c01::22c as permitted sender) client-ip=2607:f8b0:400c:c01::22c; Received: by mail-ve0-f172.google.com with SMTP id jz11so8896967veb.17 for ; Mon, 30 Jun 2014 17:16:00 -0700 (PDT) X-Received: by 10.58.220.230 with SMTP id pz6mr40982924vec.9.1404173760210; Mon, 30 Jun 2014 17:16:00 -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 tc5csp177598vcb; Mon, 30 Jun 2014 17:15:59 -0700 (PDT) X-Received: by 10.66.163.98 with SMTP id yh2mr45148513pab.104.1404173759377; Mon, 30 Jun 2014 17:15:59 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id ze10si24949275pac.23.2014.06.30.17.15.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Jun 2014 17:15:59 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-return-84143-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 31509 invoked by alias); 1 Jul 2014 00:15:37 -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 31404 invoked by uid 89); 1 Jul 2014 00:15:36 -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:15:35 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s610FWV2003728 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 30 Jun 2014 20:15:32 -0400 Received: from redacted.bos.redhat.com ([10.18.17.143]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s610FUcI014243 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Mon, 30 Jun 2014 20:15:32 -0400 Date: Mon, 30 Jun 2014 20:15:30 -0400 From: Kyle McMartin To: binutils@sourceware.org Cc: will.newton@linaro.org, nickc@redhat.com Subject: [PATCH 1/2] ld/testsuite: Check DF_STATIC_TLS is correctly added Message-ID: <20140701001530.GA9511@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:c01::22c 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 Most TLS tests appear to be predicated on Linux, so add a check for static TLS relocs causing DF_STATIC_TLS to be set to shared.exp in the Linux specific tests section. Checked that this doesn't regress the existing pair of tests on AArch64 and X86-64, and that the added test correctly fails on AArch64 and passes elsewhere (where DF_STATIC_TLS is added already.) ld/testsuite/ChangeLog: 2014-06-30 Kyle McMartin * ld-elf/shared.exp: Add a test to ensure shared libraries with static TLS relocs correctly get DF_STATIC_TLS set. Also refactor the linux specific tests to match the rest of the file. * ld-elf/tls-flag-static_tls.c: New file. * ld-elf/tls-flag-static_tls.rd: New file. --- a/ld/testsuite/ld-elf/shared.exp +++ b/ld/testsuite/ld-elf/shared.exp @@ -467,25 +467,19 @@ run_ld_link_exec_tests [] $run_cxx_tests if { [istarget *-*-linux*] || [istarget *-*-nacl*] || [istarget *-*-gnu*] } { - run_cc_link_tests [list \ - [list \ - "Build libpr2404b.a with PIE" \ - "" \ - "-fPIE" \ - { pr2404b.c } \ - {} \ - "libpr2404b.a" \ - ] \ - ] - run_ld_link_exec_tests [] [list \ - [list \ - "Run pr2404 with PIE" \ - "-pie tmpdir/pr2404b.o tmpdir/libpr2404a.so" \ - "" \ - { dummy.c } \ - "pr2404pie" \ - "pr2404.out" \ - "-fPIE" \ - ] \ - ] + set build_gnu_tests { + {"Build libpr2404b.a with PIE" + "" "-fPIE" + {pr2404b.c} {} "libpr2404b.a"} + {"Build tls-flag-static_tls.so" + "-shared" "-fPIC" + {tls-flag-static_tls.c} {{readelf {-d} tls-flag-static_tls.rd}} "tls-flag-static_tls.so"} + } + run_cc_link_tests $build_gnu_tests + set run_gnu_tests { + {"Run pr2404 with PIE" + "-pie tmpdir/pr2404b.o tmpdir/libpr2404a.so" "" + {dummy.c} "pr2404pie" "pr2404.out" "-fPIE"} + } + run_ld_link_exec_tests [] $run_gnu_tests } --- /dev/null +++ b/ld/testsuite/ld-elf/tls-flag-static_tls.c @@ -0,0 +1,2 @@ +__thread int tmp_ie __attribute__ ((tls_model ("initial-exec"))); +void *tmp_ie_func(void) { return &tmp_ie; } --- /dev/null +++ b/ld/testsuite/ld-elf/tls-flag-static_tls.rd @@ -0,0 +1,4 @@ +Dynamic section at offset 0x[0-9a-f]+ contains [0-9]+ entries: +#... + +0x[0-9a-f]+ +\(FLAGS\) +STATIC_TLS +#...