From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 114009 invoked by alias); 20 Apr 2016 18:13:11 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 113998 invoked by uid 89); 20 Apr 2016 18:13:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.5 required=5.0 tests=BAYES_50,FREEMAIL_FROM,SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=melf_x86_64, x8664exp, ld-x86-64, UD:x86-64.exp X-HELO: mga09.intel.com Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 20 Apr 2016 18:13:00 +0000 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP; 20 Apr 2016 11:12:55 -0700 X-ExtLoop1: 1 Received: from gnu-6.sc.intel.com ([172.25.70.218]) by fmsmga002.fm.intel.com with ESMTP; 20 Apr 2016 11:12:54 -0700 From: "H.J. Lu" To: binutils@sourceware.org Subject: [PATCH] Add ld-x86-64/pie2 test Date: Wed, 20 Apr 2016 18:13:00 -0000 Message-Id: <1461175973-382-1-git-send-email-hjl.tools@gmail.com> X-IsSubscribed: yes X-SW-Source: 2016-04/txt/msg00343.txt.bz2 * testsuite/ld-x86-64/pie2.d: New file. * testsuite/ld-x86-64/pie2.s: Likewise. * testsuite/ld-x86-64/x86-64.exp: Run pie2. --- ld/ChangeLog | 6 ++++++ ld/testsuite/ld-x86-64/pie2.d | 3 +++ ld/testsuite/ld-x86-64/pie2.s | 8 ++++++++ ld/testsuite/ld-x86-64/x86-64.exp | 1 + 4 files changed, 18 insertions(+) create mode 100644 ld/testsuite/ld-x86-64/pie2.d create mode 100644 ld/testsuite/ld-x86-64/pie2.s diff --git a/ld/ChangeLog b/ld/ChangeLog index efa69f9..0ce4e2d 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,5 +1,11 @@ 2016-04-20 H.J. Lu + * testsuite/ld-x86-64/pie2.d: New file. + * testsuite/ld-x86-64/pie2.s: Likewise. + * testsuite/ld-x86-64/x86-64.exp: Run pie2. + +2016-04-20 H.J. Lu + PR ld/19969 * testsuite/ld-x86-64/pr19969.d: New file. * testsuite/ld-x86-64/pr19969a.S: Likewise. diff --git a/ld/testsuite/ld-x86-64/pie2.d b/ld/testsuite/ld-x86-64/pie2.d new file mode 100644 index 0000000..ef9f58a --- /dev/null +++ b/ld/testsuite/ld-x86-64/pie2.d @@ -0,0 +1,3 @@ +#as: --64 +#ld: -pie -melf_x86_64 +#error: .*relocation R_X86_64_32 against symbol `foo' can not be used when making a shared object; recompile with -fPIC diff --git a/ld/testsuite/ld-x86-64/pie2.s b/ld/testsuite/ld-x86-64/pie2.s new file mode 100644 index 0000000..7c489a1 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pie2.s @@ -0,0 +1,8 @@ + .text + .global _start +_start: + .long foo + .data + .globl foo +foo: + .byte 0 diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp index fbd39af..b923fba 100644 --- a/ld/testsuite/ld-x86-64/x86-64.exp +++ b/ld/testsuite/ld-x86-64/x86-64.exp @@ -249,6 +249,7 @@ run_dump_test "pr14215" run_dump_test "pr14207" run_dump_test "gotplt1" run_dump_test "pie1" +run_dump_test "pie2" run_dump_test "largecomm-1a" run_dump_test "largecomm-1b" run_dump_test "largecomm-1c" -- 2.5.5