From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8752 invoked by alias); 6 Sep 2012 04:26:31 -0000 Received: (qmail 8737 invoked by uid 22791); 6 Sep 2012 04:26:27 -0000 X-SWARE-Spam-Status: No, hits=-3.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-vb0-f41.google.com (HELO mail-vb0-f41.google.com) (209.85.212.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 06 Sep 2012 04:26:14 +0000 Received: by vbkv13 with SMTP id v13so1054402vbk.0 for ; Wed, 05 Sep 2012 21:26:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.68.110 with SMTP id v14mr599310vdt.14.1346905573406; Wed, 05 Sep 2012 21:26:13 -0700 (PDT) Received: by 10.58.234.39 with HTTP; Wed, 5 Sep 2012 21:26:13 -0700 (PDT) In-Reply-To: <20120905034538.GS3159@bubble.grove.modra.org> References: <20120905034538.GS3159@bubble.grove.modra.org> Date: Thu, 06 Sep 2012 04:26:00 -0000 Message-ID: Subject: Re: [GOLD] testsuite tweaks for powerpc From: "H.J. Lu" To: binutils@sourceware.org, Alan Modra Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes 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 X-SW-Source: 2012-09/txt/msg00067.txt.bz2 On Tue, Sep 4, 2012 at 8:45 PM, Alan Modra wrote: > Various test tweaks for powerpc. > - Non-pic shared libs don't work. > - Adding synthetic syms lets the test see the ordering of code sections > which is what the tests are checking, rather than the ordering of > .opd entries. > - memory_test assumes 4k pages > - justsyms_exec looks at the address of a function, which on powerpc64 > is the descriptor in .opd, a data section. > - .toc input sections on powerpc64 need to be part of the .got output > section. > > Tested on x86_64 too. OK? > > * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc. > * configure: Regenerate. > * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm. > (plugin_final_layout.stdout): Likewise. > (memory_test): Set page sizes to 0x1000. > * testsuite/Makefile.in: Regenerate. > * testsuite/discard_locals_test.sh: Add FIXME comment. > * testsuite/justsyms_exec.c: Disable function test for powerpc64. > * testsuite/pr14265.t: Add .got output section statement. > * testsuite/script_test_2.t: Likewise. > * testsuite/script_test_3.t: Likewise. > * testsuite/script_test_4.t: Likewise. > * testsuite/script_test_5.t: Likewise. > * testsuite/script_test_6.t: Likewise. > * testsuite/script_test_7.t: Likewise. > * testsuite/script_test_9.t: Likewise. > > Index: gold/testsuite/script_test_3.t > =================================================================== > RCS file: /cvs/src/src/gold/testsuite/script_test_3.t,v > retrieving revision 1.5 > diff -u -p -r1.5 script_test_3.t > --- gold/testsuite/script_test_3.t 15 Sep 2010 17:39:57 -0000 1.5 > +++ gold/testsuite/script_test_3.t 5 Sep 2012 03:20:05 -0000 > @@ -35,6 +35,7 @@ SECTIONS > . = ALIGN(0x100); > .dynamic : { *(.dynamic) } :data :dynamic > .data : { *(.data) } :data > + .got : { *(.got .toc) } > .tdata : { *(.tdata*) } :data :tls > .tbss : { *(.tbss*) } :data :tls > . += 0x100000; > Index: gold/testsuite/script_test_4.t > =================================================================== > RCS file: /cvs/src/src/gold/testsuite/script_test_4.t,v > retrieving revision 1.2 > diff -u -p -r1.2 script_test_4.t > --- gold/testsuite/script_test_4.t 15 Sep 2010 17:39:57 -0000 1.2 > +++ gold/testsuite/script_test_4.t 5 Sep 2012 03:20:05 -0000 > @@ -37,6 +37,7 @@ SECTIONS > . = ALIGN(0x100); > .dynamic : { *(.dynamic) } > .data : { *(.data) } > + .got : { *(.got .toc) } > . += 0x100000; > . = ALIGN(0x100); > .bss : { *(.bss) } This change generates strange section layout on x86-64: [28] .got.plt PROGBITS 0000000010101d40 001d40 000060 00 WA 0 0 8 [29] .tdata PROGBITS 0000000010101da0 001da0 00002c 00 WAT 0 0 8 [30] .tbss NOBITS 0000000010101dd0 001dd0 00002c 00 WAT 0 0 8 [31] .got PROGBITS 0000000010101dd0 001dd0 000008 00 WA 0 0 8 The executable runs. But on x32, I got [28] .got.plt PROGBITS 10101b20 001b20 000060 00 WA 0 0 8 [29] .tdata PROGBITS 10101b80 001b80 000024 00 WAT 0 0 8 [30] .tbss NOBITS 10101ba4 001ba4 000020 00 WAT 0 0 4 [31] .got PROGBITS 10101ba8 001ba8 000008 00 WA 0 0 8 and [hjl@gnu-6 testsuite]$ ./tls_script_test Segmentation fault [hjl@gnu-6 testsuite]$ Total failures on x32 are: /bin/sh: line 1: 30456 Segmentation fault "$tst" > script_test_3.log-t 2>&1FAIL: script_test_3 PASS: binary_test PASS: thin_archive_test_1 /bin/sh: line 1: 30493 Segmentation fault "$tst" > tls_phdrs_script_test.log-t 2>&1 FAIL: tls_phdrs_script_test /bin/sh: line 1: 30486 Segmentation fault "$tst" > tls_script_test.log-t 2>&1 PASS: relro_now_test FAIL: tls_script_test I think they work by pure luck on other targets. This patch fixes those 3 failures on x32. I didn't change other linker scripts since they don't cause any failures. -- H.J. --- diff --git a/gold/testsuite/script_test_3.t b/gold/testsuite/script_test_3.t index 9c75194..accd055 100644 --- a/gold/testsuite/script_test_3.t +++ b/gold/testsuite/script_test_3.t @@ -36,6 +36,7 @@ SECTIONS .dynamic : { *(.dynamic) } :data :dynamic .data : { *(.data) } :data .got : { *(.got .toc) } + .got.plt : { *(.got.plt) } .tdata : { *(.tdata*) } :data :tls .tbss : { *(.tbss*) } :data :tls . += 0x100000; diff --git a/gold/testsuite/script_test_4.t b/gold/testsuite/script_test_4.t index f5569c5..3ba5e93 100644 --- a/gold/testsuite/script_test_4.t +++ b/gold/testsuite/script_test_4.t @@ -38,6 +38,7 @@ SECTIONS .dynamic : { *(.dynamic) } .data : { *(.data) } .got : { *(.got .toc) } + .got.plt : { *(.got.plt) } . += 0x100000; . = ALIGN(0x100); .bss : { *(.bss) }