This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] fix ld-size test cases for nacl targets


ld/testsuite/
2013-06-04  Roland McGrath  <mcgrathr@google.com>

	* ld-size/size.exp: For *-*-nacl* targets, use options_regsub(ld)
	to massage -m arguments into _nacl variants.
	* ld/testsuite/ld-size/size32-1-i386.d: Loosen regexps so they
	don't care what the exact addresses are.
	* ld/testsuite/ld-size/size32-1-x32.d: Likewise.
	* ld/testsuite/ld-size/size32-1-x86-64.d: Likewise.
	* ld/testsuite/ld-size/size32-2-i386.d: Likewise.
	* ld/testsuite/ld-size/size32-2-x32.d: Likewise.
	* ld/testsuite/ld-size/size32-2-x86-64.d: Likewise.
	* ld/testsuite/ld-size/size64-1-x32.d: Likewise.
	* ld/testsuite/ld-size/size64-1-x86-64.d: Likewise.
	* ld/testsuite/ld-size/size64-2-x32.d: Likewise.
	* ld/testsuite/ld-size/size64-2-x86-64.d: Likewise.

--- a/ld/testsuite/ld-size/size.exp
+++ b/ld/testsuite/ld-size/size.exp
@@ -35,6 +35,13 @@ if {!(([istarget "i?86-*-*"]
     return
 }

+# So as to avoid rewriting every last test case here in a nacl variant,
+# we use black magic to massage the generic cases into nacl-variant cases.
+if [istarget "*-*-nacl*"] {
+    # Change all the -melf_i386 to -melf_i386_nacl so linking can succeed.
+    set options_regsub(ld) {-m(\\S+) -m\\1_nacl}
+}
+
 set test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
 foreach t $test_list {
     # We need to strip the ".d", but can leave the dirname.
@@ -44,7 +51,7 @@ foreach t $test_list {

 # We need a native system.
 if ![isnative] {
-    verbose "Natibe size relocation tests not run - not a native toolchain"
+    verbose "Native size relocation tests not run - not a native toolchain"
     return
 }

--- a/ld/testsuite/ld-size/size32-1-i386.d
+++ b/ld/testsuite/ld-size/size32-1-i386.d
@@ -8,15 +8,15 @@

 DYNAMIC RELOCATION RECORDS
 OFFSET   TYPE              VALUE
-0+11f4 R_386_SIZE32      xxx
-0+11f8 R_386_SIZE32      xxx
-0+11fc R_386_SIZE32      xxx
-0+1200 R_386_SIZE32      yyy
-0+1204 R_386_SIZE32      zzz
+[[:xdigit:]]+ R_386_SIZE32      xxx
+[[:xdigit:]]+ R_386_SIZE32      xxx
+[[:xdigit:]]+ R_386_SIZE32      xxx
+[[:xdigit:]]+ R_386_SIZE32      yyy
+[[:xdigit:]]+ R_386_SIZE32      zzz


 Contents of section .data:
- 11f4 00000000 e2ffffff 1e000000 00000000  ................
- 1204 00000000 00000000 00000000 00000000  ................
- 1214 00000000 00000000 00000000 00000000  ................
- 1224 00000000 00000000 00000000           ............
+ [[:xdigit:]]+ 00000000 e2ffffff 1e000000 00000000  ................
+ [[:xdigit:]]+ 00000000 00000000 00000000 00000000  ................
+ [[:xdigit:]]+ 00000000 00000000 00000000 00000000  ................
+ [[:xdigit:]]+ 00000000 00000000 00000000           ............
--- a/ld/testsuite/ld-size/size32-1-x32.d
+++ b/ld/testsuite/ld-size/size32-1-x32.d
@@ -8,15 +8,15 @@

 DYNAMIC RELOCATION RECORDS
 OFFSET   TYPE              VALUE
-0+200220 R_X86_64_SIZE32   xxx
-0+200224 R_X86_64_SIZE32   xxx-0x0000001e
-0+200228 R_X86_64_SIZE32   xxx\+0x0000001e
-0+20022c R_X86_64_SIZE32   yyy
-0+200230 R_X86_64_SIZE32   zzz
+[[:xdigit:]]+ R_X86_64_SIZE32   xxx
+[[:xdigit:]]+ R_X86_64_SIZE32   xxx-0x0000001e
+[[:xdigit:]]+ R_X86_64_SIZE32   xxx\+0x0000001e
+[[:xdigit:]]+ R_X86_64_SIZE32   yyy
+[[:xdigit:]]+ R_X86_64_SIZE32   zzz


 Contents of section .data:
- 200220 00000000 00000000 00000000 00000000  ................
- 200230 00000000 00000000 00000000 00000000  ................
- 200240 00000000 00000000 00000000 00000000  ................
- 200250 00000000 00000000 00000000           ............
+ [[:xdigit:]]+ 00000000 00000000 00000000 00000000  ................
+ [[:xdigit:]]+ 00000000 00000000 00000000 00000000  ................
+ [[:xdigit:]]+ 00000000 00000000 00000000 00000000  ................
+ [[:xdigit:]]+ 00000000 00000000 00000000           ............
--- a/ld/testsuite/ld-size/size32-1-x86-64.d
+++ b/ld/testsuite/ld-size/size32-1-x86-64.d
@@ -8,15 +8,15 @@

 DYNAMIC RELOCATION RECORDS
 OFFSET           TYPE              VALUE
-0+200360 R_X86_64_SIZE32   xxx
-0+200364 R_X86_64_SIZE32   xxx-0x000000000000001e
-0+200368 R_X86_64_SIZE32   xxx\+0x000000000000001e
-0+20036c R_X86_64_SIZE32   yyy
-0+200370 R_X86_64_SIZE32   zzz
+[[:xdigit:]]+ R_X86_64_SIZE32   xxx
+[[:xdigit:]]+ R_X86_64_SIZE32   xxx-0x000000000000001e
+[[:xdigit:]]+ R_X86_64_SIZE32   xxx\+0x000000000000001e
+[[:xdigit:]]+ R_X86_64_SIZE32   yyy
+[[:xdigit:]]+ R_X86_64_SIZE32   zzz


 Contents of section .data:
- 200360 00000000 00000000 00000000 00000000  ................
- 200370 00000000 00000000 00000000 00000000  ................
- 200380 00000000 00000000 00000000 00000000  ................
- 200390 00000000 00000000 00000000           ............
+ [[:xdigit:]]+ 00000000 00000000 00000000 00000000  ................
+ [[:xdigit:]]+ 00000000 00000000 00000000 00000000  ................
+ [[:xdigit:]]+ 00000000 00000000 00000000 00000000  ................
+ [[:xdigit:]]+ 00000000 00000000 00000000           ............
--- a/ld/testsuite/ld-size/size32-2-i386.d
+++ b/ld/testsuite/ld-size/size32-2-i386.d
@@ -8,13 +8,13 @@

 DYNAMIC RELOCATION RECORDS
 OFFSET   TYPE              VALUE
-0+123c R_386_SIZE32      xxx
-0+1240 R_386_SIZE32      yyy
-0+1244 R_386_SIZE32      zzz
-0+1248 R_386_SIZE32      zzz
-0+124c R_386_SIZE32      zzz
+[[:xdigit:]]+ R_386_SIZE32      xxx
+[[:xdigit:]]+ R_386_SIZE32      yyy
+[[:xdigit:]]+ R_386_SIZE32      zzz
+[[:xdigit:]]+ R_386_SIZE32      zzz
+[[:xdigit:]]+ R_386_SIZE32      zzz


 Contents of section .data:
- 123c 00000000 00000000 00000000 e2ffffff  ................
- 124c 1e000000                             ....
+ [[:xdigit:]]+ 00000000 00000000 00000000 e2ffffff  ................
+ [[:xdigit:]]+ 1e000000                             ....
--- a/ld/testsuite/ld-size/size32-2-x32.d
+++ b/ld/testsuite/ld-size/size32-2-x32.d
@@ -8,13 +8,13 @@

 DYNAMIC RELOCATION RECORDS
 OFFSET   TYPE              VALUE
-0+200278 R_X86_64_SIZE32   xxx
-0+20027c R_X86_64_SIZE32   yyy
-0+200280 R_X86_64_SIZE32   zzz
-0+200284 R_X86_64_SIZE32   zzz-0x0000001e
-0+200288 R_X86_64_SIZE32   zzz\+0x0000001e
+[[:xdigit:]]+ R_X86_64_SIZE32   xxx
+[[:xdigit:]]+ R_X86_64_SIZE32   yyy
+[[:xdigit:]]+ R_X86_64_SIZE32   zzz
+[[:xdigit:]]+ R_X86_64_SIZE32   zzz-0x0000001e
+[[:xdigit:]]+ R_X86_64_SIZE32   zzz\+0x0000001e


 Contents of section .data:
- 200278 00000000 00000000 00000000 00000000  ................
- 200288 00000000                             ....
+ [[:xdigit:]]+ 00000000 00000000 00000000 00000000  ................
+ [[:xdigit:]]+ 00000000                             ....
--- a/ld/testsuite/ld-size/size32-2-x86-64.d
+++ b/ld/testsuite/ld-size/size32-2-x86-64.d
@@ -8,13 +8,13 @@

 DYNAMIC RELOCATION RECORDS
 OFFSET           TYPE              VALUE
-0+2003d8 R_X86_64_SIZE32   xxx
-0+2003dc R_X86_64_SIZE32   yyy
-0+2003e0 R_X86_64_SIZE32   zzz
-0+2003e4 R_X86_64_SIZE32   zzz-0x000000000000001e
-0+2003e8 R_X86_64_SIZE32   zzz\+0x000000000000001e
+[[:xdigit:]]+ R_X86_64_SIZE32   xxx
+[[:xdigit:]]+ R_X86_64_SIZE32   yyy
+[[:xdigit:]]+ R_X86_64_SIZE32   zzz
+[[:xdigit:]]+ R_X86_64_SIZE32   zzz-0x000000000000001e
+[[:xdigit:]]+ R_X86_64_SIZE32   zzz\+0x000000000000001e


 Contents of section .data:
- 2003d8 00000000 00000000 00000000 00000000  ................
- 2003e8 00000000                             ....
+ [[:xdigit:]]+ 00000000 00000000 00000000 00000000  ................
+ [[:xdigit:]]+ 00000000                             ....
--- a/ld/testsuite/ld-size/size64-1-x32.d
+++ b/ld/testsuite/ld-size/size64-1-x32.d
@@ -8,16 +8,16 @@

 DYNAMIC RELOCATION RECORDS
 OFFSET   TYPE              VALUE
-0+200220 R_X86_64_SIZE32   xxx
-0+200228 R_X86_64_SIZE64   xxx-0x0000001e
-0+200230 R_X86_64_SIZE64   xxx\+0x0000001e
-0+200238 R_X86_64_SIZE32   yyy
-0+200240 R_X86_64_SIZE32   zzz
+[[:xdigit:]]+ R_X86_64_SIZE32   xxx
+[[:xdigit:]]+ R_X86_64_SIZE64   xxx-0x0000001e
+[[:xdigit:]]+ R_X86_64_SIZE64   xxx\+0x0000001e
+[[:xdigit:]]+ R_X86_64_SIZE32   yyy
+[[:xdigit:]]+ R_X86_64_SIZE32   zzz


 Contents of section .data:
- 200220 00000000 00000000 00000000 00000000  ................
- 200230 00000000 00000000 00000000 00000000  ................
- 200240 00000000 00000000 00000000 00000000  ................
- 200250 00000000 00000000 00000000 00000000  ................
- 200260 00000000 00000000 00000000 00000000  ................
+ [[:xdigit:]]+ 00000000 00000000 00000000 00000000  ................
+ [[:xdigit:]]+ 00000000 00000000 00000000 00000000  ................
+ [[:xdigit:]]+ 00000000 00000000 00000000 00000000  ................
+ [[:xdigit:]]+ 00000000 00000000 00000000 00000000  ................
+ [[:xdigit:]]+ 00000000 00000000 00000000 00000000  ................
--- a/ld/testsuite/ld-size/size64-1-x86-64.d
+++ b/ld/testsuite/ld-size/size64-1-x86-64.d
@@ -8,16 +8,16 @@

 DYNAMIC RELOCATION RECORDS
 OFFSET           TYPE              VALUE
-0+200360 R_X86_64_SIZE64   xxx
-0+200368 R_X86_64_SIZE64   xxx-0x000000000000001e
-0+200370 R_X86_64_SIZE64   xxx\+0x000000000000001e
-0+200378 R_X86_64_SIZE64   yyy
-0+200380 R_X86_64_SIZE64   zzz
+[[:xdigit:]]+ R_X86_64_SIZE64   xxx
+[[:xdigit:]]+ R_X86_64_SIZE64   xxx-0x000000000000001e
+[[:xdigit:]]+ R_X86_64_SIZE64   xxx\+0x000000000000001e
+[[:xdigit:]]+ R_X86_64_SIZE64   yyy
+[[:xdigit:]]+ R_X86_64_SIZE64   zzz


 Contents of section .data:
- 200360 00000000 00000000 00000000 00000000  ................
- 200370 00000000 00000000 00000000 00000000  ................
- 200380 00000000 00000000 00000000 00000000  ................
- 200390 00000000 00000000 00000000 00000000  ................
- 2003a0 00000000 00000000 00000000 00000000  ................
+ [[:xdigit:]]+ 00000000 00000000 00000000 00000000  ................
+ [[:xdigit:]]+ 00000000 00000000 00000000 00000000  ................
+ [[:xdigit:]]+ 00000000 00000000 00000000 00000000  ................
+ [[:xdigit:]]+ 00000000 00000000 00000000 00000000  ................
+ [[:xdigit:]]+ 00000000 00000000 00000000 00000000  ................
--- a/ld/testsuite/ld-size/size64-2-x32.d
+++ b/ld/testsuite/ld-size/size64-2-x32.d
@@ -8,14 +8,14 @@

 DYNAMIC RELOCATION RECORDS
 OFFSET   TYPE              VALUE
-0+200278 R_X86_64_SIZE32   xxx
-0+200280 R_X86_64_SIZE32   yyy
-0+200288 R_X86_64_SIZE32   zzz
-0+200290 R_X86_64_SIZE64   zzz-0x0000001e
-0+200298 R_X86_64_SIZE64   zzz\+0x0000001e
+[[:xdigit:]]+ R_X86_64_SIZE32   xxx
+[[:xdigit:]]+ R_X86_64_SIZE32   yyy
+[[:xdigit:]]+ R_X86_64_SIZE32   zzz
+[[:xdigit:]]+ R_X86_64_SIZE64   zzz-0x0000001e
+[[:xdigit:]]+ R_X86_64_SIZE64   zzz\+0x0000001e


 Contents of section .data:
- 200278 00000000 00000000 00000000 00000000  ................
- 200288 00000000 00000000 00000000 00000000  ................
- 200298 00000000 00000000                    ........
+ [[:xdigit:]]+ 00000000 00000000 00000000 00000000  ................
+ [[:xdigit:]]+ 00000000 00000000 00000000 00000000  ................
+ [[:xdigit:]]+ 00000000 00000000                    ........
--- a/ld/testsuite/ld-size/size64-2-x86-64.d
+++ b/ld/testsuite/ld-size/size64-2-x86-64.d
@@ -8,14 +8,14 @@

 DYNAMIC RELOCATION RECORDS
 OFFSET           TYPE              VALUE
-0+2003d8 R_X86_64_SIZE64   xxx
-0+2003e0 R_X86_64_SIZE64   yyy
-0+2003e8 R_X86_64_SIZE64   zzz
-0+2003f0 R_X86_64_SIZE64   zzz-0x000000000000001e
-0+2003f8 R_X86_64_SIZE64   zzz\+0x000000000000001e
+[[:xdigit:]]+ R_X86_64_SIZE64   xxx
+[[:xdigit:]]+ R_X86_64_SIZE64   yyy
+[[:xdigit:]]+ R_X86_64_SIZE64   zzz
+[[:xdigit:]]+ R_X86_64_SIZE64   zzz-0x000000000000001e
+[[:xdigit:]]+ R_X86_64_SIZE64   zzz\+0x000000000000001e


 Contents of section .data:
- 2003d8 00000000 00000000 00000000 00000000  ................
- 2003e8 00000000 00000000 00000000 00000000  ................
- 2003f8 00000000 00000000                    ........
+ [[:xdigit:]]+ 00000000 00000000 00000000 00000000  ................
+ [[:xdigit:]]+ 00000000 00000000 00000000 00000000  ................
+ [[:xdigit:]]+ 00000000 00000000                    ........


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]