# Copyright 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2003, 2004, 2006, 2007,
-# 2009 Free Software Foundation, Inc.
+# 2009, 2010 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# This file was written by Rob Savoye <rob@cygnus.com>
# and extended by Ian Lance Taylor <ian@cygnus.com>
+proc load_common_lib { name } {
+ load_lib $name
+}
+
+load_common_lib binutils-common.exp
+
proc binutil_version { prog } {
if ![is_remote host] {
set path [which $prog]
}
#
-# default_binutils_assemble
+# default_binutils_assemble_flags
# assemble a file
#
-proc default_binutils_assemble { source object } {
+proc default_binutils_assemble_flags { source object asflags } {
global srcdir
global host_triplet
set source asm.s
}
- set exec_output [target_assemble $source $object ""]
+ set exec_output [target_assemble $source $object $asflags]
set exec_output [prune_warnings $exec_output]
if [string match "" $exec_output] {
}
}
-#
-# 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 hppa*64*-*-hpux*] \
- && ![istarget ia64-*-hpux*] \
- && ![istarget *-*-linux*] \
- && ![istarget *-*-irix5*] \
- && ![istarget *-*-irix6*] \
- && ![istarget *-*-netbsd*] \
- && ![istarget *-*-solaris2*] } {
- return 0
- }
-
- if { [istarget *-*-linux*aout*] \
- || [istarget *-*-linux*oldld*] } {
- return 0
- }
-
- if { ![istarget *-*-netbsdelf*] \
- && ([istarget *-*-netbsd*aout*] \
- || [istarget *-*-netbsdpe*] \
- || [istarget arm*-*-netbsd*] \
- || [istarget sparc-*-netbsd*] \
- || [istarget i*86-*-netbsd*] \
- || [istarget m68*-*-netbsd*] \
- || [istarget vax-*-netbsd*] \
- || [istarget ns32k-*-netbsd*]) } {
- return 0
- }
- return 1
-}
-
#
# exe_ext
# Returns target executable extension, if any.
}
set opts(addr2line) {}
set opts(ar) {}
+ set opts(as) {}
set opts(nm) {}
set opts(objcopy) {}
set opts(objdump) {}
unresolved $subdir/$name
return
}
+
+ # Permit the option to use $srcdir to refer to the source
+ # directory.
+ regsub -all "\\\$srcdir" "$opt_val" "$srcdir/$subdir" opt_val
+
if [string length $opts($opt_name)] {
perror "option $opt_name multiply set in $file.d"
unresolved $subdir/$name
unresolved $subdir/$name
return
}
+
+ # Permit the option to use $srcdir to refer to the source
+ # directory.
+ regsub -all "\\\$srcdir" "$opt_val" "$srcdir/$subdir" opt_val
+
# add extra option to end of existing option, adding space
# if necessary.
if [string length $opts($opt_name)] {
set srcfile $srcdir/$subdir/$opts(source)
}
- set exec_output [binutils_assemble ${srcfile} $tempfile]
+ set exec_output [binutils_assemble_flags ${srcfile} $tempfile $opts(as)]
if [string match "" $exec_output] then {
send_log "$exec_output\n"
verbose "$exec_output"