X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=blobdiff_plain;f=gcc%2Ftestsuite%2Flib%2Ffile-format.exp;h=fe88a3b1c95a6ca7bef4eee95a0ba47f6f088595;hp=ab2b9f17f6873708d2a5f764584b6921fcae6988;hb=7f6a6b46ae992d6df3a66a26c17d8b31e29e2250;hpb=18fe718e28d2dfac79f2e20dec4fc72d9185422c diff --git a/gcc/testsuite/lib/file-format.exp b/gcc/testsuite/lib/file-format.exp index ab2b9f17f68..fe88a3b1c95 100644 --- a/gcc/testsuite/lib/file-format.exp +++ b/gcc/testsuite/lib/file-format.exp @@ -15,25 +15,38 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Please email any bugs, comments, and/or additions to this file to: -# egcs-bugs@egcs.cygnus.com +# gcc-bugs@gcc.gnu.org # This file defines a proc for determining the file format in use by the # target. This is useful for tests that are only supported by certain file -# formats. This procedure is defined in a seperate file so that it can be +# formats. This procedure is defined in a separate file so that it can be # included by other expect library files. proc gcc_target_object_format { } { global gcc_target_object_format_saved + global target_triplet + global tool if [info exists gcc_target_object_format_saved] { verbose "gcc_target_object_format returning saved $gcc_target_object_format_saved" 2 + } elseif { [string match "*-*-darwin*" $target_triplet] } { + # Darwin doesn't necessarily have objdump, so hand-code it. + set gcc_target_object_format_saved mach-o + } elseif { [string match "hppa*-*-hpux*" $target_triplet] } { + # HP-UX doesn't necessarily have objdump, so hand-code it. + if { [string match "hppa*64*-*-hpux*" $target_triplet] } { + set gcc_target_object_format_saved elf + } else { + set gcc_target_object_format_saved som + } } else { set objdump_name [find_binutils_prog objdump] set open_file [open objfmtst.c w] puts $open_file "void foo(void) { }" close $open_file - gcc_target_compile objfmtst.c objfmtst.o object "" + ${tool}_target_compile objfmtst.c objfmtst.o object "" + file delete objfmtst.c catch { set output [exec $objdump_name --file-headers objfmtst.o ] @@ -61,6 +74,9 @@ proc gcc_target_object_format { } { pe { set gcc_target_object_format_saved pe } + som { + set gcc_target_object_format_saved som + } default { verbose "Unknown file format: $objformat" 3 set gcc_target_object_format_saved unknown