PR 12763
authorAlan Modra <amodra@gmail.com>
Fri, 20 May 2011 15:33:29 +0000 (15:33 +0000)
committerAlan Modra <amodra@gmail.com>
Fri, 20 May 2011 15:33:29 +0000 (15:33 +0000)
* ld-elf/tdata3.s: New test.
* ld-elf/tbss3.s: New test.
* ld-elf/binutils.exp: Consolidate tbss and tdata tests.

ld/testsuite/ChangeLog
ld/testsuite/ld-elf/binutils.exp
ld/testsuite/ld-elf/tbss3.s [new file with mode: 0644]
ld/testsuite/ld-elf/tdata3.s [new file with mode: 0644]

index fb47469cc5d244252774229f54f2a15f65c9ad34..16804290d3a4a72efcac4d3e8f1ac66cede73bfe 100644 (file)
@@ -1,3 +1,10 @@
+2011-05-21  Alan Modra  <amodra@gmail.com>
+
+       PR 12763
+       * ld-elf/tdata3.s: New test.
+       * ld-elf/tbss3.s: New test.
+       * ld-elf/binutils.exp: Consolidate tbss and tdata tests.
+
 2011-05-20  Bernd Schmidt  <bernds@codesourcery.com>
 
        * ld-tic6x/pcr-reloc.d: New test.
index 6f881f349035552725e1530fdb862ec5a75962d7..47636d2f315ecbf72de53421f86d4ba09cac21b7 100644 (file)
@@ -121,35 +121,22 @@ if { ([istarget "i?86-*-elf*"]
 
 binutils_test strip "-T ${srcdir}/${subdir}/lma.lnk" lma
 
+set tls_tests { "tdata1" "tdata2" "tdata3" }
 # hppa64 has its own .tbss section, with different flags.
 if { ![istarget "hppa64-*-*"] } {
-    binutils_test objcopy "" tbss1
-    binutils_test objcopy "-z relro" tbss1
-    binutils_test objcopy "-shared" tbss1
-    binutils_test objcopy "-shared -z relro" tbss1
-    binutils_test objcopy "-z max-page-size=0x100000" tbss1
-    binutils_test objcopy "-z max-page-size=0x100000 -z common-page-size=0x1000" tbss1
+    lappend tls_tests "tbss1" "tbss2" "tbss3"
 }
-
-binutils_test objcopy "" tdata1
-binutils_test objcopy "-z relro" tdata1
-binutils_test objcopy "-shared" tdata1
-binutils_test objcopy "-shared -z relro" tdata1
-binutils_test objcopy "-z max-page-size=0x100000" tdata1
-binutils_test objcopy "-z max-page-size=0x100000 -z common-page-size=0x1000" tdata1
-
-if { ![istarget "hppa64-*-*"] } {
-    binutils_test objcopy "" tbss2
-    binutils_test objcopy "-z relro" tbss2
-    binutils_test objcopy "-shared" tbss2
-    binutils_test objcopy "-shared -z relro" tbss2
-    binutils_test objcopy "-z max-page-size=0x100000" tbss2
-    binutils_test objcopy "-z max-page-size=0x100000 -z common-page-size=0x1000" tbss2
+set tls_opts {
+    ""
+    "-z relro"
+    "-shared"
+    "-shared -z relro"
+    "-z max-page-size=0x100000"
+    "-z max-page-size=0x100000 -z common-page-size=0x1000"
 }
 
-binutils_test objcopy "" tdata2
-binutils_test objcopy "-z relro" tdata2
-binutils_test objcopy "-shared" tdata2
-binutils_test objcopy "-shared -z relro" tdata2
-binutils_test objcopy "-z max-page-size=0x100000" tdata2
-binutils_test objcopy "-z max-page-size=0x100000 -z common-page-size=0x1000" tdata2
+foreach testitem $tls_tests {
+    foreach testopt $tls_opts {
+       binutils_test objcopy $testopt $testitem
+    }
+}
diff --git a/ld/testsuite/ld-elf/tbss3.s b/ld/testsuite/ld-elf/tbss3.s
new file mode 100644 (file)
index 0000000..f5530a3
--- /dev/null
@@ -0,0 +1,17 @@
+       .globl main
+       .globl start
+       .globl _start
+       .globl __start
+       .text
+main:
+start:
+_start:
+__start:
+       .byte 0
+
+       .section .tbss,"awT",%nobits
+       .p2align 10
+       .type   tbss, %object
+       .size   tbss, 1024
+tbss:
+       .zero   1024
diff --git a/ld/testsuite/ld-elf/tdata3.s b/ld/testsuite/ld-elf/tdata3.s
new file mode 100644 (file)
index 0000000..8886360
--- /dev/null
@@ -0,0 +1,23 @@
+       .globl main
+       .globl start
+       .globl _start
+       .globl __start
+       .text
+main:
+start:
+_start:
+__start:
+       .byte 0
+
+       .section .tdata,"awT",%progbits
+       .type   tdata,%object
+       .size   tdata,1
+tdata:
+       .byte 17
+
+       .section .tbss,"awT",%nobits
+       .p2align 10
+       .type   tbss, %object
+       .size   tbss, 1024
+tbss:
+       .zero   1024