From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27825 invoked by alias); 11 Jul 2011 12:05:40 -0000 Received: (qmail 27817 invoked by uid 22791); 11 Jul 2011 12:05:39 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-gx0-f169.google.com (HELO mail-gx0-f169.google.com) (209.85.161.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 11 Jul 2011 12:05:25 +0000 Received: by gxk23 with SMTP id 23so1722055gxk.0 for ; Mon, 11 Jul 2011 05:05:24 -0700 (PDT) Received: by 10.150.150.38 with SMTP id x38mr4267381ybd.45.1310385924301; Mon, 11 Jul 2011 05:05:24 -0700 (PDT) Received: from bubble.grove.modra.org ([115.187.252.19]) by mx.google.com with ESMTPS id a16sm664173ybn.17.2011.07.11.05.05.21 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 11 Jul 2011 05:05:23 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 9E0D2175A005; Mon, 11 Jul 2011 21:35:17 +0930 (CST) Date: Mon, 11 Jul 2011 12:53:00 -0000 From: Alan Modra To: binutils@sourceware.org Subject: ppc64_elf_edit_toc segfault tests Message-ID: <20110711120517.GK26365@bubble.grove.modra.org> Mail-Followup-To: binutils@sourceware.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) 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: 2011-07/txt/msg00108.txt.bz2 This adds tests for two segfaults existing in ppc64_elf_edit toc before http://sourceware.org/ml/binutils/2011-02/msg00067.html and the followup patches. * ld-powerpc/tocopt2.s, * ld-powerpc/tocopt2.out, * ld-powerpc/tocopt2.d: New test. * ld-powerpc/tocopt3.s, * ld-powerpc/tocopt3.d: New test. * ld-powerpc/powerpc.exp (ppc64elftests) Run them. Index: ld/testsuite/ld-powerpc/powerpc.exp =================================================================== RCS file: /cvs/src/src/ld/testsuite/ld-powerpc/powerpc.exp,v retrieving revision 1.33 diff -u -p -r1.33 powerpc.exp --- ld/testsuite/ld-powerpc/powerpc.exp 23 Mar 2011 15:25:06 -0000 1.33 +++ ld/testsuite/ld-powerpc/powerpc.exp 11 Jul 2011 07:53:35 -0000 @@ -204,7 +204,11 @@ set ppc64elftests { {"sym@tocbase" "-shared -melf64ppc" "-a64" {symtocbase-1.s symtocbase-2.s} {{objdump -dj.data symtocbase.d}} "symtocbase.so"} {"TOC opt" "-melf64ppc" "-a64" {tocopt.s} - {{objdump -s tocopt.d}} "tocopt"} + {{objdump -s tocopt.d}} "tocopt"} + {"TOC opt2" "-melf64ppc --defsym x=2" "-a64" {tocopt2.s} + {{ld tocopt2.out} {objdump -s tocopt2.d}} "tocopt2"} + {"TOC opt3" "-melf64ppc -no-keep-memory --defsym x=2" "-a64" {tocopt3.s} + {{objdump -s tocopt3.d}} "tocopt3"} } Index: ld/testsuite/ld-powerpc/tocopt2.d =================================================================== RCS file: ld/testsuite/ld-powerpc/tocopt2.d diff -N ld/testsuite/ld-powerpc/tocopt2.d --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ ld/testsuite/ld-powerpc/tocopt2.d 11 Jul 2011 07:53:35 -0000 @@ -0,0 +1,5 @@ + +.*: file format .* + +Contents of section \.text: + 100000b0 3d22effe 39297f4a .* Index: ld/testsuite/ld-powerpc/tocopt2.out =================================================================== RCS file: ld/testsuite/ld-powerpc/tocopt2.out diff -N ld/testsuite/ld-powerpc/tocopt2.out --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ ld/testsuite/ld-powerpc/tocopt2.out 11 Jul 2011 07:53:35 -0000 @@ -0,0 +1 @@ +.*: xt defined on removed toc entry Index: ld/testsuite/ld-powerpc/tocopt2.s =================================================================== RCS file: ld/testsuite/ld-powerpc/tocopt2.s diff -N ld/testsuite/ld-powerpc/tocopt2.s --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ ld/testsuite/ld-powerpc/tocopt2.s 11 Jul 2011 07:53:35 -0000 @@ -0,0 +1,10 @@ + .globl xt + .section .toc,"aw" +xt: + .quad x + + .globl _start + .text +_start: + addis 9,2,xt@toc@ha + ld 9,xt@toc@l(9) Index: ld/testsuite/ld-powerpc/tocopt3.d =================================================================== RCS file: ld/testsuite/ld-powerpc/tocopt3.d diff -N ld/testsuite/ld-powerpc/tocopt3.d --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ ld/testsuite/ld-powerpc/tocopt3.d 11 Jul 2011 07:53:35 -0000 @@ -0,0 +1,5 @@ + +.*: file format .* + +Contents of section \.text: + 100000b0 3d22effe 39297f4a .* Index: ld/testsuite/ld-powerpc/tocopt3.s =================================================================== RCS file: ld/testsuite/ld-powerpc/tocopt3.s diff -N ld/testsuite/ld-powerpc/tocopt3.s --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ ld/testsuite/ld-powerpc/tocopt3.s 11 Jul 2011 07:53:35 -0000 @@ -0,0 +1,9 @@ + .section .toc,"aw" +0: + .quad x + + .globl _start + .text +_start: + addis 9,2,0b@toc@ha + ld 9,0b@toc@l(9) -- Alan Modra Australia Development Lab, IBM