From 9b4fce51f3c0aed948f47063b10d1db611523b22 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Tue, 4 Jun 2013 19:24:10 +0000 Subject: [PATCH] ld/testsuite/ * 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. --- ld/testsuite/ChangeLog | 16 ++++++++++++++++ ld/testsuite/ld-size/size.exp | 9 ++++++++- ld/testsuite/ld-size/size32-1-i386.d | 18 +++++++++--------- ld/testsuite/ld-size/size32-1-x32.d | 18 +++++++++--------- ld/testsuite/ld-size/size32-1-x86-64.d | 18 +++++++++--------- ld/testsuite/ld-size/size32-2-i386.d | 14 +++++++------- ld/testsuite/ld-size/size32-2-x32.d | 14 +++++++------- ld/testsuite/ld-size/size32-2-x86-64.d | 14 +++++++------- ld/testsuite/ld-size/size64-1-x32.d | 20 ++++++++++---------- ld/testsuite/ld-size/size64-1-x86-64.d | 20 ++++++++++---------- ld/testsuite/ld-size/size64-2-x32.d | 16 ++++++++-------- ld/testsuite/ld-size/size64-2-x86-64.d | 16 ++++++++-------- 12 files changed, 108 insertions(+), 85 deletions(-) diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 3bfea87f268..8d959dbeb00 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,19 @@ +2013-06-04 Roland McGrath + + * 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. + 2013-06-04 H.J. Lu * ld-i386/tlsbindesc-nacl.rd: Updated for text/data/bss section diff --git a/ld/testsuite/ld-size/size.exp b/ld/testsuite/ld-size/size.exp index 9fe152c3d75..9eedfd5b398 100644 --- 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 } diff --git a/ld/testsuite/ld-size/size32-1-i386.d b/ld/testsuite/ld-size/size32-1-i386.d index e8a6622f092..43091c12550 100644 --- 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 ............ diff --git a/ld/testsuite/ld-size/size32-1-x32.d b/ld/testsuite/ld-size/size32-1-x32.d index 1022dba4200..083f7b2d4c3 100644 --- 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 ............ diff --git a/ld/testsuite/ld-size/size32-1-x86-64.d b/ld/testsuite/ld-size/size32-1-x86-64.d index 80c4a66abd4..a913dc2f36d 100644 --- 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 ............ diff --git a/ld/testsuite/ld-size/size32-2-i386.d b/ld/testsuite/ld-size/size32-2-i386.d index 2db0e1d33ea..636e87f8d46 100644 --- 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 .... diff --git a/ld/testsuite/ld-size/size32-2-x32.d b/ld/testsuite/ld-size/size32-2-x32.d index 9c1eae2695c..c619a00f2a0 100644 --- 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 .... diff --git a/ld/testsuite/ld-size/size32-2-x86-64.d b/ld/testsuite/ld-size/size32-2-x86-64.d index 1851e0f021e..9091944405a 100644 --- 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 .... diff --git a/ld/testsuite/ld-size/size64-1-x32.d b/ld/testsuite/ld-size/size64-1-x32.d index 51c2f1355e3..36815915ae5 100644 --- 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 ................ diff --git a/ld/testsuite/ld-size/size64-1-x86-64.d b/ld/testsuite/ld-size/size64-1-x86-64.d index c4ed9c27baf..36c2912e97c 100644 --- 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 ................ diff --git a/ld/testsuite/ld-size/size64-2-x32.d b/ld/testsuite/ld-size/size64-2-x32.d index 1a30c984fe5..f9f31b5bff1 100644 --- 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 ........ diff --git a/ld/testsuite/ld-size/size64-2-x86-64.d b/ld/testsuite/ld-size/size64-2-x86-64.d index 4cc11cfde34..099c8abc231 100644 --- 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 ........ -- 2.30.2