From: Alan Modra <amodra@gmail.com>
To: binutils@sourceware.org
Subject: ppc64_elf_edit_toc segfault tests
Date: Mon, 11 Jul 2011 12:53:00 -0000 [thread overview]
Message-ID: <20110711120517.GK26365@bubble.grove.modra.org> (raw)
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
reply other threads:[~2011-07-11 12:05 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110711120517.GK26365@bubble.grove.modra.org \
--to=amodra@gmail.com \
--cc=binutils@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).