* lib/ld-lib.exp (check_gc_sections_available): Fail more targets.

* ld-discard/discard.exp: Move xfails from here..
	* ld-discard/extern.d: ..to here.
	* ld-discard/start.d: ..and here.
	* ld-discard/static.d: ..and here.
	* ld-elf/binutils.exp: Don't run tbss1 and tbss2 tests on hppa64.
	* ld-elf/empty2.d: Remove xfails.
	* ld-elf/flags1.d: xfail hppa64.
	* ld-elf/group1.d: Add comment.
	* ld-elf/group2.d: xfail cr16 and crx.
	* ld-elf/group3b.d: Correct xfail and add comment.
	* ld-elf/group4.d: xfail cr16 and crx.
	* ld-elf/group5.d: Likewise.
	* ld-elf/group6.d: Likewise.
	* ld-elf/group7.d: Likewise.
	* ld-elf/group8a.d: Add more notarget and xfail entries.  Comment.
	* ld-elf/group8b.d: Likewise.
	* ld-elf/group9a.d: Likewise.
	* ld-elf/group9b.d: Likewise.
	* ld-elf/linkonce2.d: Correct notarget and comment.
	* ld-elf/merge2.d: Remove iq2000 from xfail.
	* ld-elf/multibss1.d: xfail hppa64.
	* ld-elf/nobits-1.d: Likewise.
	* ld-elf/note-1.d: Likewise.
	* ld-elf/note-2.d: Likewise.
	* ld-elf/orphan-region.d: Add xfails.
	* ld-elf/orphan-region.ld: Discard some sections.
	* ld-elf/orphan.d: Add xfails.
	* ld-elf/orphan.ld: Discard some sections.
	* ld-elf/orphan3.d: Replace xfail frv-*-* with frv-*-elf.  Remove
	cr16, crx and d10v.
	* ld-elf/pr349.d: Add xfails.
	* ld-elf/warn2.d: Add xfails.  Tweak symbol section for hppa64.
	* ld-scripts/rgn-at5.t: Discard .reginfo.
This commit is contained in:
Alan Modra 2010-09-18 02:30:41 +00:00
parent 553c671747
commit de5c4ae21c
34 changed files with 151 additions and 45 deletions

View File

@ -1,3 +1,40 @@
2010-09-18 Alan Modra <amodra@gmail.com>
* lib/ld-lib.exp (check_gc_sections_available): Fail more targets.
* ld-discard/discard.exp: Move xfails from here..
* ld-discard/extern.d: ..to here.
* ld-discard/start.d: ..and here.
* ld-discard/static.d: ..and here.
* ld-elf/binutils.exp: Don't run tbss1 and tbss2 tests on hppa64.
* ld-elf/empty2.d: Remove xfails.
* ld-elf/flags1.d: xfail hppa64.
* ld-elf/group1.d: Add comment.
* ld-elf/group2.d: xfail cr16 and crx.
* ld-elf/group3b.d: Correct xfail and add comment.
* ld-elf/group4.d: xfail cr16 and crx.
* ld-elf/group5.d: Likewise.
* ld-elf/group6.d: Likewise.
* ld-elf/group7.d: Likewise.
* ld-elf/group8a.d: Add more notarget and xfail entries. Comment.
* ld-elf/group8b.d: Likewise.
* ld-elf/group9a.d: Likewise.
* ld-elf/group9b.d: Likewise.
* ld-elf/linkonce2.d: Correct notarget and comment.
* ld-elf/merge2.d: Remove iq2000 from xfail.
* ld-elf/multibss1.d: xfail hppa64.
* ld-elf/nobits-1.d: Likewise.
* ld-elf/note-1.d: Likewise.
* ld-elf/note-2.d: Likewise.
* ld-elf/orphan-region.d: Add xfails.
* ld-elf/orphan-region.ld: Discard some sections.
* ld-elf/orphan.d: Add xfails.
* ld-elf/orphan.ld: Discard some sections.
* ld-elf/orphan3.d: Replace xfail frv-*-* with frv-*-elf. Remove
cr16, crx and d10v.
* ld-elf/pr349.d: Add xfails.
* ld-elf/warn2.d: Add xfails. Tweak symbol section for hppa64.
* ld-scripts/rgn-at5.t: Discard .reginfo.
2010-09-16 Alan Modra <amodra@gmail.com>
* ld-elf/orphan-region.d: xfail for spu.

View File

@ -43,8 +43,5 @@ set test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
for { set i 0 } { $i < [llength $test_list] } { incr i } {
# We need to strip the ".d", but can leave the dirname.
verbose [file rootname [lindex $test_list $i]]
# These fail because they use the generic linker.
setup_xfail "arc-*" "d30v-*" "dlx-*" "i960-*" "m6812-*" "m68hc12-*"
setup_xfail "or32-*" "pj-*"
run_dump_test [file rootname [lindex $test_list $i]]
}

View File

@ -2,6 +2,8 @@
#ld: -T discard.ld
#error: .*data.* referenced in section `\.text' of tmpdir/dump0.o: defined in discarded section `\.data\.exit' of tmpdir/dump0.o
#objdump: -p
#xfail: arc-*-* d30v-*-* dlx-*-* i960-*-* or32-*-* pj*-*-*
#xfail: m68hc12-*-* m6812-*-*
#pass
# The expected warning used to start with "`data' referenced..." but
# this has two problems: 1) It does not include the name of the linker

View File

@ -3,4 +3,6 @@
#ld: -T discard.ld
#error: `data' referenced in section `\.text' of tmpdir/dump0.o: defined in discarded section `\.data\.exit' of tmpdir/dump1.o
#objdump: -p
#xfail: arc-*-* d30v-*-* dlx-*-* i960-*-* or32-*-* pj*-*-*
#xfail: m68hc12-*-* m6812-*-*
#pass

View File

@ -2,4 +2,6 @@
#ld: -T discard.ld
#error: `(\.data\.exit|data)' referenced in section `\.text' of tmpdir/dump0.o: defined in discarded section `\.data\.exit' of tmpdir/dump0.o
#objdump: -p
#xfail: arc-*-* d30v-*-* dlx-*-* i960-*-* or32-*-* pj*-*-*
#xfail: m68hc12-*-* m6812-*-*
#pass

View File

@ -120,24 +120,31 @@ if { ([istarget "i?86-*-elf*"]
binutils_test strip "-T ${srcdir}/${subdir}/lma.lnk" lma
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
# 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
}
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
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
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
}
binutils_test objcopy "" tdata2
binutils_test objcopy "-z relro" tdata2

View File

@ -1,7 +1,6 @@
#source: empty2.s
#ld:
#readelf: -s
#xfail: "d30v-*-*" "dlx-*-*" "i960-*-*" "or32-*-*" "pj-*-*"
#...
[ ]+[0-9]+:[ ]+0+[ ]+0[ ]+FILE[ ]+LOCAL[ ]+DEFAULT[ ]+ABS empty2.s

View File

@ -4,12 +4,13 @@
#readelf: -l --wide
#xfail: "arm*-*-*" "xscale-*-*"
#xfail: "avr-*-*" "dlx-*-*" "h8300-*-*" "m32r-*-*" "msp430-*-*" "tic6x-*-*"
#xfail: "*-*-hpux*"
#xfail: "*-*-hpux*" "hppa*64*-*-*"
# Fails on the ARM because the .section type character is % rather than @.
# Fails on the AVR, DLX, H8300, M32R, MSP430 and TI C6X because the two
# sections are not merged into one segment. (There is no good reason why
# they have to be).
# Fails on HPUX systems because the .type pseudo-op behaves differently.
# Fails on hppa64 because a PHDR is always added.
#...
Program Headers:

View File

@ -2,7 +2,9 @@
#source: group1b.s
#ld: -T group.ld
#readelf: -s
#xfail: "arc-*-*" "d30v-*-*" "dlx-*-*" "i960-*-*" "or32-*-*" "pj-*-*"
#xfail: arc-*-* d30v-*-* dlx-*-* i960-*-* or32-*-* pj*-*-*
# generic linker targets don't comply with all symbol merging rules
Symbol table '.symtab' contains .* entries:
#...
.*: 0+1000 +0 +(NOTYPE|OBJECT) +WEAK +DEFAULT +. foo

View File

@ -1,6 +1,9 @@
#source: ../../../binutils/testsuite/binutils-all/group.s
#ld: -r
#readelf: -Sg --wide
#xfail: cr16-*-* crx-*-*
# cr16 and crx use non-standard scripts with memory regions, which don't play
# well with unique group sections under ld -r.
#...
\[[ 0-9]+\] foo_group[ \t]+GROUP[ \t]+.*

View File

@ -2,7 +2,8 @@
#source: group3a.s
#ld: -T group.ld
#readelf: -s
#notarget arc-*-* d30v-*-* dlx-*-* i960-*-* or32-*-* pj*-*-*
#xfail: arc-*-* d30v-*-* dlx-*-* i960-*-* or32-*-* pj*-*-*
# generic linker targets don't comply with all symbol merging rules
Symbol table '.symtab' contains .* entries:
#...

View File

@ -1,6 +1,9 @@
#source: ../../../binutils/testsuite/binutils-all/group-2.s
#ld: -r
#readelf: -Sg --wide
#xfail: cr16-*-* crx-*-*
# cr16 and crx use non-standard scripts with memory regions, which don't play
# well with unique group sections under ld -r.
#...
\[[ 0-9]+\] .group[ \t]+GROUP[ \t]+.*

View File

@ -1,6 +1,9 @@
#source: ../../../binutils/testsuite/binutils-all/group-3.s
#ld: -r
#readelf: -Sg --wide
#xfail: cr16-*-* crx-*-*
# cr16 and crx use non-standard scripts with memory regions, which don't play
# well with unique group sections under ld -r.
#...
\[[ 0-9]+\] .group[ \t]+GROUP[ \t]+.*

View File

@ -1,6 +1,9 @@
#source: ../../../binutils/testsuite/binutils-all/group-4.s
#ld: -r
#readelf: -Sg --wide
#xfail: cr16-*-* crx-*-*
# cr16 and crx use non-standard scripts with memory regions, which don't play
# well with unique group sections under ld -r.
#...
\[[ 0-9]+\] .group[ \t]+GROUP[ \t]+.*

View File

@ -4,6 +4,9 @@
#source: ../../../binutils/testsuite/binutils-all/group-4.s
#ld: -r
#readelf: -g --wide
#xfail: cr16-*-* crx-*-*
# cr16 and crx use non-standard scripts with memory regions, which don't play
# well with unique group sections under ld -r.
#...
COMDAT group section \[[ 0-9]+\] `foo_group' \[foo_group\] contains 2 sections:

View File

@ -1,8 +1,12 @@
#source: group8.s
#ld: -r --gc-sections --entry foo
#readelf: -g --wide
#notarget: ia64-*-* mep-*-*
#xfail: dlx-*-* openrisc-*-* or32-*-* alpha-*-* arc-*-* hppa64-*-*
#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* or32-*-* pj*-*-*
#notarget: alpha-*-* hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-*
#xfail: cr16-*-* crx-*-*
# generic linker targets don't support --gc-sections, nor do a bunch of others
# cr16 and crx use non-standard scripts with memory regions, which don't play
# well with unique group sections under ld -r.
COMDAT group section \[[ 0-9]+\] `.group' \[foo\] contains 1 sections:
\[Index\] Name

View File

@ -1,8 +1,12 @@
#source: group8.s
#ld: -r --gc-sections --entry bar
#readelf: -g --wide
#notarget: ia64-*-* mep-*-*
#xfail: dlx-*-* openrisc-*-* or32-*-* alpha-*-* arc-*-* hppa64-*-*
#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* or32-*-* pj*-*-*
#notarget: alpha-*-* hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-*
#xfail: cr16-*-* crx-*-*
# generic linker targets don't support --gc-sections, nor do a bunch of others
# cr16 and crx use non-standard scripts with memory regions, which don't play
# well with unique group sections under ld -r.
COMDAT group section \[[ 0-9]+\] `.group' \[bar\] contains 1 sections:
\[Index\] Name

View File

@ -1,8 +1,12 @@
#source: group9.s
#ld: -r --gc-sections --entry foo
#readelf: -g --wide
#notarget: ia64-*-* mep-*-*
#xfail: dlx-*-* openrisc-*-* or32-*-* alpha-*-* arc-*-*
#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* or32-*-* pj*-*-*
#notarget: alpha-*-* hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-*
#xfail: cr16-*-* crx-*-*
# generic linker targets don't support --gc-sections, nor do a bunch of others
# cr16 and crx use non-standard scripts with memory regions, which don't play
# well with unique group sections under ld -r.
COMDAT group section \[[ 0-9]+\] `.group' \[foo\] contains 2 sections:
\[Index\] Name

View File

@ -1,8 +1,12 @@
#source: group9.s
#ld: -r --gc-sections --entry bar
#readelf: -g --wide
#notarget: ia64-*-* mep-*-*
#xfail: dlx-*-* openrisc-*-* or32-*-* alpha-*-* hppa64-*-* arc-*-*
#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* or32-*-* pj*-*-*
#notarget: alpha-*-* hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-*
#xfail: cr16-*-* crx-*-*
# generic linker targets don't support --gc-sections, nor do a bunch of others
# cr16 and crx use non-standard scripts with memory regions, which don't play
# well with unique group sections under ld -r.
COMDAT group section \[[ 0-9]+\] `.group' \[foo\] contains 2 sections:
\[Index\] Name

View File

@ -2,7 +2,8 @@
#source: linkonce1b.s
#ld: -emit-relocs
#objdump: -r
#notarget arc-*-* d30v-*-* dlx-*-* i960-*-* or32-*-* pj*-*-*
#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* or32-*-* pj*-*-*
# generic elf targets don't emit relocs
.*: file format .*

View File

@ -2,7 +2,7 @@
#ld: -T merge.ld
#objdump: -s
#xfail: "arc-*-*" "d30v-*-*" "dlx-*-*" "hppa64-*-*"
#xfail: "i960-*-*" "ip2k-*-*" "iq2000-*-*" "or32-*-*" "pj-*-*"
#xfail: "i960-*-*" "ip2k-*-*" "or32-*-*" "pj-*-*"
.*: file format .*elf.*

View File

@ -2,6 +2,8 @@
#ld: -e 0
#readelf: -l --wide
#target: *-*-linux*
#xfail: hppa64-*-*
# hppa64 default script add 16 bytes at start of .data giving 0x500010 p_memsz
#...
+LOAD +0x[^ ]+ +0x[^ ]+ +0x[^ ]+ +0x[^ ]+ +0x500000 .*

View File

@ -1,5 +1,7 @@
#ld: -Tnobits-1.t
#readelf: -l --wide
#xfail: hppa64-*-*
# hppa64 adds PHDR
#...
Section to Segment mapping:

View File

@ -1,5 +1,7 @@
#ld: -Tnote-1.t
#readelf: -l --wide
#xfail: hppa64-*-*
# hppa64 adds PHDR
#...
Section to Segment mapping:

View File

@ -1,6 +1,8 @@
#ld: -Tnote-2.t
#objcopy_linked_file: -R .foo
#readelf: -l --wide
#xfail: hppa64-*-*
# hppa64 adds PHDR
#...
Program Headers:

View File

@ -1,7 +1,11 @@
#source: orphan-region.s
#ld: -T orphan-region.ld -N
#readelf: -S -l --wide
#xfail: spu-*-*
#xfail: arc-*-* d30v-*-* dlx-*-* fr30-*-* frv-*-elf i860-*-* i960-*-*
#xfail: iq*-*-* mn10200-*-* moxie-*-* msp*-*-* mt-*-* or32-*-* pj*-*-*
#xfail: spu-*-* hppa*64*-*-*
# if not using elf32.em, you don't get fancy orphan handling
# spu twiddles LOAD range, hppa64 adds PHDR
#...
\[[ 0-9]+\] \.text[ \t]+PROGBITS[ \t]+0*40000000[ \t]+.*

View File

@ -7,4 +7,5 @@ SECTIONS
{
.text : ALIGN (4) { *(.text) } > region
.rodata : ALIGN (4) { *(.rodata) } > region
/DISCARD/ : { *(.reginfo) *(.trampolines) }
}

View File

@ -1,6 +1,9 @@
#source: orphan.s
#ld: -T orphan.ld
#readelf: -S --wide
#xfail: arc-*-* d30v-*-* dlx-*-* fr30-*-* frv-*-elf i860-*-* i960-*-*
#xfail: iq*-*-* mn10200-*-* moxie-*-* msp*-*-* mt-*-* or32-*-* pj*-*-*
# if not using elf32.em, you don't get fancy orphan handling
#...
\[[ 0-9]+\] \.(text|notbad)[ \t]+PROGBITS[ \t0-9a-f]+AX?.*

View File

@ -4,5 +4,5 @@ SECTIONS
.data : { *(.data) }
.bss : { *(.bss) *(COMMON) }
.note : { *(.note) }
.reginfo : { *(.reginfo) }
/DISCARD/ : { *(.reginfo) *(.trampolines) }
}

View File

@ -6,10 +6,10 @@
#source: orphan3f.s
#ld:
#readelf: -S --wide
#xfail: "arc-*-*" "d30v-*-*" "dlx-*-*" "fr30-*-*" "frv-*-*"
#xfail: "arc-*-*" "d30v-*-*" "dlx-*-*" "fr30-*-*" "frv-*-elf"
#xfail: "i860-*-*" "i960-*-*" "iq2000-*-*" "mn10200-*-*" "msp430-*-*" "mt-*-*"
#xfail: "or32-*-*" "pj-*-*"
#xfail: "cr16-*-*" "crx-*-*" "d10v-*-*" "xstormy16-*-*"
#xfail: "xstormy16-*-*"
#...
\[[ 0-9]+\] \.foo +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +0+20 +0+ +A +0 +0 +[0-9]+

View File

@ -2,6 +2,9 @@
#source: pr349-2.s
#ld: -r
#readelf: -S
#xfail: arc-*-* d30v-*-* dlx-*-* fr30-*-* frv-*-elf i860-*-* i960-*-*
#xfail: iq*-*-* mn10200-*-* moxie-*-* msp*-*-* mt-*-* or32-*-* pj*-*-*
# if not using elf32.em, you don't get fancy section handling
#...
.* .abcxyz .*

View File

@ -5,11 +5,13 @@
#warning: ^[^\\n]*\.[obj]+: warning: function 'Foo' used$
#readelf: -s
#notarget: "sparc64-*-solaris2*" "sparcv9-*-solaris2*"
#xfail: "arc-*-*" "d30v-*-*" "dlx-*-*" "i960-*-*" "or32-*-*" "pj-*-*"
#xfail: arc-*-* d30v-*-* dlx-*-* fr30-*-* frv-*-elf i860-*-* i960-*-*
#xfail: iq*-*-* mn10200-*-* moxie-*-* msp*-*-* mt-*-* or32-*-* pj*-*-*
# if not using elf32.em, you don't get fancy section handling
# Check that warnings are generated for the symbols in .gnu.warning
# construct and that the symbol still appears as expected.
#...
+[0-9]+: +[0-9a-f]+ +20 +OBJECT +GLOBAL +DEFAULT +[1-3] Foo
+[0-9]+: +[0-9a-f]+ +20 +OBJECT +GLOBAL +DEFAULT +[1-9] Foo
#pass

View File

@ -18,12 +18,5 @@ SECTIONS
.sec3 0x5000 : { *(*.sec3) }
/* In theory we could put:
/DISCARD/ : { *(*) }
here as we do not need any other sections for this test.
In practice however doing so breaks GOLD as it relies upon
being able to create/find various other sections such as
.dynamic, .dynsym and .gnu.hash. */
/DISCARD/ : { *(.reginfo) }
}

View File

@ -1656,9 +1656,19 @@ proc check_gc_sections_available { } {
if {![info exists gc_sections_available_saved]} {
# Some targets don't support gc-sections despite whatever's
# advertised by ld's options.
if { [istarget alpha*-*-*]
|| [istarget mep-*-*]
if {[istarget arc-*-*]
|| [istarget d30v-*-*]
|| [istarget dlx-*-*]
|| [istarget i960-*-*]
|| [istarget or32-*-*]
|| [istarget pj*-*-*]
|| [istarget alpha-*-*]
|| [istarget hppa64-*-*]
|| [istarget i370-*-*]
|| [istarget i860-*-*]
|| [istarget ia64-*-*]
|| [istarget mep-*-*]
|| [istarget mn10200-*-*]
|| [istarget *-*-cygwin]
|| [istarget *-*-mingw*] } {
set gc_sections_available_saved 0