]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - ld/testsuite/ld-undefined/undefined.exp
Update year range in copyright notice of binutils files
[thirdparty/binutils-gdb.git] / ld / testsuite / ld-undefined / undefined.exp
index f97db1cd1a32c85053f46121ee48693363ef37c2..4480dfc8ebbb136b321ab17c72d3752272f91ee0 100644 (file)
@@ -1,7 +1,7 @@
 # Test that the linker reports undefined symbol errors correctly.
 # By Ian Lance Taylor, Cygnus Support
 #
-#   Copyright (C) 1995-2018 Free Software Foundation, Inc.
+#   Copyright (C) 1995-2021 Free Software Foundation, Inc.
 #
 # This file is part of the GNU Binutils.
 #
@@ -24,12 +24,12 @@ set testund "undefined"
 set testfn "undefined function"
 set testline "undefined line"
 
-if { ![is_remote host] && [which $CC] == 0 } {
+if { ![check_compiler_available] } {
     verbose "Could not find C compiler!" 1
     untested $testund
     untested $testfn
     untested $testline
-} elseif { ![ld_compile "$CC -g" $srcdir/$subdir/undefined.c tmpdir/undefined.o] } {
+} elseif { ![ld_compile "$CC -g $NOLTO_CFLAGS" $srcdir/$subdir/undefined.c tmpdir/undefined.o] } {
     verbose "Unable to compile test file!" 1
     unresolved $testund
     unresolved $testfn
@@ -40,9 +40,14 @@ if { ![is_remote host] && [which $CC] == 0 } {
     set flags [big_or_little_endian]
 
     # Using -e start prevents the SunOS linker from trying to build a
-    # shared library.
-    send_log "$ld -e start $flags -o tmpdir/undefined tmpdir/undefined.o\n"
-    set exec_output [run_host_cmd "$ld" "-e start $flags -o tmpdir/undefined tmpdir/undefined.o"]
+    # shared library.  But don't use an entry point in BPF targets.
+    switch -glob $target_triplet {
+        bpf-*-* { set entry "" }
+        * { set entry "-e start" }
+    }
+
+    send_log "$ld $entry $flags -o tmpdir/undefined tmpdir/undefined.o\n"
+    set exec_output [run_host_cmd "$ld" "$entry $flags -o tmpdir/undefined tmpdir/undefined.o"]
 
     send_log "$exec_output\n"
     verbose "$exec_output"
@@ -124,7 +129,6 @@ if { ![is_remote host] && [which $CC] == 0 } {
     setup_xfail mcore-*-elf
     setup_xfail mep-*-*
     setup_xfail mips-sgi-irix6*
-    setup_xfail "sh64-*-*"
     # Fails for the MSP430 because it uses SYM_DIFF relocs but it does
     # not provide a special_function for handling them.  If
     # optimization is enabled then this test passes because
@@ -143,6 +147,9 @@ if { ![is_remote host] && [which $CC] == 0 } {
     setup_xfail xtensa*-*-linux*
     setup_xfail hppa*64*-*-*
 
+    # eBPF doesn't support dwarf yet.
+    setup_xfail bpf-*-*
+
     checkund $ml $testline
 }