* lib/ld-lib.exp (run_dump_test): Add -L$srcdir/$subdir.
[deliverable/binutils-gdb.git] / ld / testsuite / lib / ld-lib.exp
index 06583e55bb6f2a41957b94064016252bb4212bd0..418c00013db3d66bcaffe9b07f2055cb3bc50faf 100644 (file)
@@ -322,6 +322,29 @@ proc default_ld_nm { nm nmflags object } {
     }
 }
 
+#
+# is_elf_format
+#      true if the object format is known to be ELF
+#
+proc is_elf_format {} {
+    if { ![istarget *-*-sysv4*] \
+        && ![istarget *-*-unixware*] \
+        && ![istarget *-*-elf*] \
+        && ![istarget *-*-eabi*] \
+        && ![istarget *-*-linux*] \
+        && ![istarget *-*-irix5*] \
+        && ![istarget *-*-irix6*] \
+        && ![istarget *-*-solaris2*] } {
+       return 0
+    }
+
+    if { [istarget *-*-linux*aout*] \
+        || [istarget *-*-linux*oldld*] } {
+       return 0
+    }
+    return 1
+}
+
 #
 # simple_diff
 #      compares two files line-by-line
@@ -685,7 +708,11 @@ proc run_dump_test { name } {
     # Perhaps link the file(s).
     if { $run_ld } {
        set objfile "tmpdir/dump"
-       set cmd "$LD $LDFLAGS $opts(ld) -o $objfile $objfiles"
+
+       # Add -L$srcdir/$subdir so that the linker command can use
+       # linker scripts in the source directory.
+       set cmd "$LD $LDFLAGS -L$srcdir/$subdir \
+                  $opts(ld) -o $objfile $objfiles"
 
        send_log "$cmd\n"
        set cmdret [catch "exec $cmd" comp_output]
This page took 0.0276 seconds and 4 git commands to generate.