From 782c0ebfc98dfc58a816440d29094a586a78ed7d Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Thu, 21 Nov 2002 13:30:31 +0000 Subject: [PATCH] * ld-elf/elf.exp: Renamed from sec64k.exp. Add test_list loop. * ld-elf/merge.s: New file. * ld-elf/merge.d: New file. * ld-elf/merge.ld: New file. --- ld/testsuite/ChangeLog | 7 +++++++ ld/testsuite/ld-elf/{sec64k.exp => elf.exp} | 17 +++++++++++++---- ld/testsuite/ld-elf/merge.d | 14 ++++++++++++++ ld/testsuite/ld-elf/merge.ld | 7 +++++++ ld/testsuite/ld-elf/merge.s | 14 ++++++++++++++ 5 files changed, 55 insertions(+), 4 deletions(-) rename ld/testsuite/ld-elf/{sec64k.exp => elf.exp} (91%) create mode 100644 ld/testsuite/ld-elf/merge.d create mode 100644 ld/testsuite/ld-elf/merge.ld create mode 100644 ld/testsuite/ld-elf/merge.s diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 0fe80b00d75..09e1f12c184 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2002-11-21 Alan Modra + + * ld-elf/elf.exp: Renamed from sec64k.exp. Add test_list loop. + * ld-elf/merge.s: New file. + * ld-elf/merge.d: New file. + * ld-elf/merge.ld: New file. + 2002-11-18 Svein E. Seldal * ld-scripts/script.exp: Setup for tic4x testcase diff --git a/ld/testsuite/ld-elf/sec64k.exp b/ld/testsuite/ld-elf/elf.exp similarity index 91% rename from ld/testsuite/ld-elf/sec64k.exp rename to ld/testsuite/ld-elf/elf.exp index bfc6d0fdcc4..0914695e575 100644 --- a/ld/testsuite/ld-elf/sec64k.exp +++ b/ld/testsuite/ld-elf/elf.exp @@ -1,4 +1,4 @@ -# Expect script for tests for >64k sections +# Expect script for various ELF tests. # Copyright 2002 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify @@ -32,15 +32,24 @@ if { [istarget *-*-linux*aout*] \ return } +set test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]] +foreach t $test_list { + # We need to strip the ".d", but can leave the dirname. + verbose [file rootname $t] + run_dump_test [file rootname $t] +} + + +# Test >64k sections, with and without -r. + # Per-port excludes, since this test takes an overwhelmingly long time # currently. if { ![istarget cris-*-*] } { return } -# Test >64k sections, with and without -r. First, create the assembly -# files. Have a relocation to another section and one within the local -# section. +# First, create the assembly files. Have a relocation to another +# section and one within the local section. set test1 "64ksec-r" set test2 "64ksec" diff --git a/ld/testsuite/ld-elf/merge.d b/ld/testsuite/ld-elf/merge.d new file mode 100644 index 00000000000..cbefcaf7606 --- /dev/null +++ b/ld/testsuite/ld-elf/merge.d @@ -0,0 +1,14 @@ +#source: merge.s +#ld: -T merge.ld +#objdump: -s +#xfail: "arc-*-*" "avr-*-*" "cris-*-*" "dlx-*-*" "fr30-*-*" "frv-*-*" +#xfail: "hppa*-*-*" "h8300-*-*" "i960-*-*" "ip2k-*-*" "m32r-*-*" "mcore-*-*" +#xfail: "mn10*-*-*" "openrisc-*-*" "pj-*-*" "sparc*-*-*" + +.*: file format .*elf.* + +Contents of section .text: + 1000 (1010)?0000(1010)? (1210)?0000(1012)? (0c)?000000(0c)? (0e)?000000(0e)? .* +Contents of section .rodata: + 1010 61626300 .* +#pass diff --git a/ld/testsuite/ld-elf/merge.ld b/ld/testsuite/ld-elf/merge.ld new file mode 100644 index 00000000000..dce91bb40db --- /dev/null +++ b/ld/testsuite/ld-elf/merge.ld @@ -0,0 +1,7 @@ +SECTIONS +{ + . = 0x1000; + .text : { *(.text .text.* .gnu.linkonce.t.*) } + .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } + .junk : { *(*) } +} diff --git a/ld/testsuite/ld-elf/merge.s b/ld/testsuite/ld-elf/merge.s new file mode 100644 index 00000000000..1e6e0e3494f --- /dev/null +++ b/ld/testsuite/ld-elf/merge.s @@ -0,0 +1,14 @@ + .section .rodata.str,"aMS","progbits",1 +.LC0: + .asciz "abc" +.LC1: + .asciz "c" + + .text + .global _start +_start: + .long .LC0 +.LT0: + .long .LC1 + .long .LC0-.LT0 + .long .LC1-.LT0 -- 2.30.2