aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ld/testsuite/ChangeLog7
-rw-r--r--ld/testsuite/ld-elf/binutils.exp41
-rw-r--r--ld/testsuite/ld-elf/tbss3.s17
-rw-r--r--ld/testsuite/ld-elf/tdata3.s23
4 files changed, 61 insertions, 27 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index fb47469..1680429 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -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.
diff --git a/ld/testsuite/ld-elf/binutils.exp b/ld/testsuite/ld-elf/binutils.exp
index 6f881f3..47636d2 100644
--- a/ld/testsuite/ld-elf/binutils.exp
+++ b/ld/testsuite/ld-elf/binutils.exp
@@ -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
index 0000000..f5530a3
--- /dev/null
+++ b/ld/testsuite/ld-elf/tbss3.s
@@ -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
index 0000000..8886360
--- /dev/null
+++ b/ld/testsuite/ld-elf/tdata3.s
@@ -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