]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - ld/testsuite/ld-scripts/phdrs.exp
* readelf.c (get_machine_dlags): Add support for RX's PID mode.
[thirdparty/binutils-gdb.git] / ld / testsuite / ld-scripts / phdrs.exp
index 7dca55505a07e9f473a1558255922564ff67d2a7..b7f3682afd50fb1858b7334fc8023edfe74a555c 100644 (file)
@@ -1,11 +1,13 @@
 # Test PHDRS in a linker script.
 # By Ian Lance Taylor, Cygnus Support.
-#   Copyright 1999, 2000, 2001, 2002, 2003, 2006
+#   Copyright 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007
 #   Free Software Foundation, Inc.
 #
-# This file is free software; you can redistribute it and/or modify
+# This file is part of the GNU Binutils.
+#
+# 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
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful,
@@ -15,7 +17,8 @@
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+# MA 02110-1301, USA.
 
 # PHDRS is only meaningful for ELF.
 if ![is_elf_format] {
@@ -49,16 +52,22 @@ set ldopt "$ldopt -T $srcdir/$subdir/phdrs.t tmpdir/phdrs.o"
 if ![ld_simple_link $ld tmpdir/phdrs $ldopt] {
     fail $testname
 } else {
-    if {[which $objdump] == 0} {
+    if {![is_remote host] && [which $objdump] == 0} {
        unresolved $testname
        return
     }
-
-    verbose -log "$objdump --private tmpdir/phdrs"
-    catch "exec $objdump --private tmpdir/phdrs" exec_output
+    set exec_output [run_host_cmd "$objdump" "--private-headers tmpdir/phdrs"]
     set exec_output [prune_warnings $exec_output]
     verbose -log $exec_output
 
+    # The RX port sets the p_paddr of loadable segments to 0 in order
+    # to be compatible with Renesas tools.  When an RX executable is
+    # loaded into a BFD based tool the code tries to reconstruct the
+    # correct vaddr and paddr values.  This is not always possible
+    # however and this test is one example of where the reconstruction
+    # fails.
+    setup_xfail rx-*-*
+    
     if [regexp $phdrs_regexp $exec_output] {
        pass $testname
     } else {