1 # Test handling of weak undefined symbols
3 set testname "weak undefined symbols"
5 # This test only works for ELF targets. It ought to work for some
6 # a.out targets, but it doesn't.
8 if { ![istarget *-*-sysv4*] \
9 && ![istarget *-*-unixware*] \
10 && ![istarget *-*-elf*] \
11 && ![istarget *-*-eabi*] \
12 && ![istarget *-*-linux*] \
13 && ![istarget *-*-irix5*] \
14 && ![istarget *-*-irix6*] \
15 && ![istarget *-*-solaris2*] } then {
19 if { [istarget *-*-linux*aout*] \
20 || [istarget *-*-linux*oldld*] } {
24 if {! [ld_assemble $as $srcdir/$subdir/weak-undef.s tmpdir/weak-undef.o]} then {
25 # It's OK if .weak doesn't work on this target.
30 # The linker should accept references to undefined weaks without error,
31 # and resolve them to zero.
34 ".*Contents of section .data:.*0000 00000000 11111111.*"
36 if {! [ld_simple_link $ld tmpdir/weak-undef "$flags tmpdir/weak-undef.o -T $srcdir/$subdir/weak-undef.t"] } then {
39 if {[which $objdump] == 0} then {
44 verbose -log "$objdump -s tmpdir/weak-undef"
45 catch "exec $objdump -s tmpdir/weak-undef" exec_output
46 set exec_output [prune_warnings $exec_output]
47 verbose -log $exec_output
49 if {[regexp $output_regexp $exec_output]} then {