This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: make check on some rtems targets


On Tue, Sep 29, 2009 at 08:41:25AM -0500, Joel Sherrill wrote:
> log/powerpc-binutils-check.log:FAIL: Check --gc-section
> log/powerpc-binutils-check.log:FAIL: Check --gc-section/-q
> log/powerpc-binutils-check.log:FAIL: S-records
> log/powerpc-binutils-check.log:FAIL: S-records with constructors

Thanks for the log you sent.  These are all due to "undefined
reference to `__eabi'" errors.  The following patch ought to fix it.
Please test.

	* lib/ld-lib.exp (ld_simple_link_defsyms): New proc, adding
	powerpc-*-rtems to code setting symbols, extracted from..
	* ld-srec/srec.exp (run_srec_test): ..here.  Correct flags for
	sh64.
	* ld-gc/gc.exp (test_gc): Use ld_simple_link_defsyms.

Index: ld/testsuite/lib/ld-lib.exp
===================================================================
RCS file: /cvs/src/src/ld/testsuite/lib/ld-lib.exp,v
retrieving revision 1.66
diff -u -p -r1.66 ld-lib.exp
--- ld/testsuite/lib/ld-lib.exp	2 Sep 2009 07:25:43 -0000	1.66
+++ ld/testsuite/lib/ld-lib.exp	30 Sep 2009 02:01:36 -0000
@@ -352,6 +352,47 @@ proc default_ld_nm { nm nmflags object }
     }
 }
 
+# Define various symbols needed when not linking against all
+# target libs.
+proc ld_simple_link_defsyms {} {
+
+    set flags "--defsym __stack_chk_fail=0"
+
+    # ARM targets call __gccmain
+    if {[istarget arm*-*-*]       || \
+        [istarget strongarm*-*-*] || \
+        [istarget xscale*-*-*]    || \
+        [istarget thumb-*-*] } {
+        append flags " --defsym __gccmain=0"
+    }
+
+    # PowerPC EABI code calls __eabi.
+    if {[istarget powerpc*-*-eabi*] || [istarget powerpc*-*-rtems]} {
+	append flags " --defsym __eabi=0"
+    }
+
+    # mn10200 code calls __truncsipsi2_d0_d2.
+    if {[istarget mn10200*-*-*]} then {
+	append flags " --defsym __truncsipsi2_d0_d2=0"
+    }
+
+    # m6811/m6812 code has references to soft registers.
+    if {[istarget m6811-*-*] || [istarget m6812-*-*]} {
+	append flags " --defsym _.frame=0 --defsym _.d1=0 --defsym _.d2=0"
+	append flags " --defsym _.d3=0 --defsym _.d4=0"
+	append flags " --defsym _.tmp=0 --defsym _.xy=0 --defsym _.z=0"
+    }
+
+    # Some OpenBSD targets have ProPolice and reference __guard and
+    # __stack_smash_handler.
+    if [istarget *-*-openbsd*] {
+	append flags " --defsym __guard=0"
+	append flags " --defsym __stack_smash_handler=0"
+    }
+
+    return $flags
+}
+
 # True if the object format is known to be ELF.
 #
 proc is_elf_format {} {
Index: ld/testsuite/ld-srec/srec.exp
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-srec/srec.exp,v
retrieving revision 1.32
diff -u -p -r1.32 srec.exp
--- ld/testsuite/ld-srec/srec.exp	23 Sep 2009 09:29:52 -0000	1.32
+++ ld/testsuite/ld-srec/srec.exp	30 Sep 2009 02:01:36 -0000
@@ -229,9 +229,9 @@ proc run_srec_test { test objs } {
     global host_triplet
 
     # Tell the ELF linker to not do anything clever with .eh_frame,
-    # not to put anything in small data, and define a symbol referenced
-    # by gcc -fstack-protector code.
-    set flags "--traditional-format -G 0 --defsym __stack_chk_fail=0"
+    # not to put anything in small data, and define various symbols.
+    set flags "--traditional-format -G 0 "
+    append flags [ld_simple_link_defsyms]
 
     # If the linker script uses SIZEOF_HEADERS, use a -Ttext argument
     # to force both the normal link and the S-record link to be put in
@@ -244,7 +244,7 @@ proc run_srec_test { test objs } {
 
     if [istarget sh64*-*-elf] {
         # This is what gcc passes to ld by default.
-        set flags "-mshelf32"
+        set flags "$flags -mshelf32"
         # SH64 targets cannot convert format in the linker 
         # using the -oformat command line switch.
 	setup_xfail "sh64*-*-*"
@@ -254,10 +254,6 @@ proc run_srec_test { test objs } {
         [istarget strongarm*-*-*] || \
         [istarget xscale*-*-*]    || \
         [istarget thumb-*-*] } {
-    
-        # ARM targets call __gccmain
-        set flags "$flags --defsym __gccmain=0"
-
         # ARM targets cannot convert format in the linker 
         # using the --oformat command line switch
 	setup_xfail "*arm*-*-*"
@@ -265,23 +261,6 @@ proc run_srec_test { test objs } {
 	setup_xfail "thumb-*-*"
     }
 
-    # PowerPC EABI code calls __eabi.
-    if [istarget powerpc*-*-eabi*] {
-	set flags "$flags --defsym __eabi=0"
-    }
-
-    # mn10200 code calls __truncsipsi2_d0_d2.
-    if {[istarget mn10200*-*-*]} then {
-	set flags "$flags --defsym __truncsipsi2_d0_d2=0"
-    }
-
-    # m6811/m6812 code has references to soft registers.
-    if {[istarget m6811-*-*] || [istarget m6812-*-*]} {
-	set flags "$flags --defsym _.frame=0 --defsym _.d1=0 --defsym _.d2=0"
-	set flags "$flags --defsym _.d3=0 --defsym _.d4=0"
-	set flags "$flags --defsym _.tmp=0 --defsym _.xy=0 --defsym _.z=0"
-    }
-
     # V850 targets need libgcc.a
     if [istarget v850*-*-elf] {
 	set objs "$objs -L ../gcc -lgcc"
@@ -292,13 +271,6 @@ proc run_srec_test { test objs } {
 	set flags "$flags -no-relax"
     }
 
-    # Some OpenBSD targets have ProPolice and reference __guard and
-    # __stack_smash_handler.
-    if [istarget *-*-openbsd*] {
-	set flags "$flags --defsym __guard=0"
-	set flags "$flags --defsym __stack_smash_handler=0"
-    }
-
     if { ![ld_simple_link $ld tmpdir/sr1 "$flags $objs"] \
 	 || ![ld_simple_link $ld tmpdir/sr2.sr "$flags --oformat srec $objs"] } {
 	fail $test
Index: ld/testsuite/ld-gc/gc.exp
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-gc/gc.exp,v
retrieving revision 1.5
diff -u -p -r1.5 gc.exp
--- ld/testsuite/ld-gc/gc.exp	15 Sep 2009 02:02:48 -0000	1.5
+++ ld/testsuite/ld-gc/gc.exp	30 Sep 2009 02:01:36 -0000
@@ -44,7 +44,8 @@ proc test_gc { testname filename linker 
     }
 
     set outfile "tmpdir/$filename"
-    set options "-L$srcdir/$subdir $ldflags $objfile"
+    set options "-L$srcdir/$subdir"
+    append options " " $ldflags " " [ld_simple_link_defsyms] " " $objfile
 
     # SH64 targets needs an extra ld option for this test.
     if [istarget sh64*-*-*] {

-- 
Alan Modra
Australia Development Lab, IBM


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]