From 67e9eb74af1c9e7fd75cf7820fd3282757bef119 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Fri, 20 May 2011 15:33:29 +0000 Subject: PR 12763 * ld-elf/tdata3.s: New test. * ld-elf/tbss3.s: New test. * ld-elf/binutils.exp: Consolidate tbss and tdata tests. --- ld/testsuite/ld-elf/binutils.exp | 41 ++++++++++++++-------------------------- ld/testsuite/ld-elf/tbss3.s | 17 +++++++++++++++++ ld/testsuite/ld-elf/tdata3.s | 23 ++++++++++++++++++++++ 3 files changed, 54 insertions(+), 27 deletions(-) create mode 100644 ld/testsuite/ld-elf/tbss3.s create mode 100644 ld/testsuite/ld-elf/tdata3.s (limited to 'ld/testsuite/ld-elf') 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 -- cgit v1.1