From 67e9eb74af1c9e7fd75cf7820fd3282757bef119 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Fri, 20 May 2011 15:33:29 +0000 Subject: [PATCH] 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/ChangeLog | 7 ++++++ ld/testsuite/ld-elf/binutils.exp | 41 +++++++++++--------------------- ld/testsuite/ld-elf/tbss3.s | 17 +++++++++++++ ld/testsuite/ld-elf/tdata3.s | 23 ++++++++++++++++++ 4 files changed, 61 insertions(+), 27 deletions(-) create mode 100644 ld/testsuite/ld-elf/tbss3.s create mode 100644 ld/testsuite/ld-elf/tdata3.s diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index fb47469cc5d..16804290d3a 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2011-05-21 Alan Modra + + 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 * ld-tic6x/pcr-reloc.d: New test. diff --git a/ld/testsuite/ld-elf/binutils.exp b/ld/testsuite/ld-elf/binutils.exp index 6f881f34903..47636d2f315 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 00000000000..f5530a3f4d3 --- /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 00000000000..88863602001 --- /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 -- 2.30.2