This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

[VxWorks, committed] Fix gcsec1.c failures


--gc-sections can't be used on VxWorks for the reasons given in the
comment below.  Tested on i586-wrs-vxworks and x86_64-linux-gnu,
applied to mainline as obvious.

Richard


gcc/testsuite/
	* lib/target-supports.exp (check_gc_sections_available): Return
	false for VxWorks targets.

Index: gcc/testsuite/lib/target-supports.exp
===================================================================
--- gcc/testsuite/lib/target-supports.exp	(revision 122924)
+++ gcc/testsuite/lib/target-supports.exp	(working copy)
@@ -286,6 +286,14 @@ proc check_gc_sections_available { } {
 	    return 0
 	}
 
+	# VxWorks kernel modules are relocatable objects linked with -r,
+	# while RTP executables are linked with -q (--emit-relocs).
+	# Both of these options are incompatible with --gc-sections.
+	if { [istarget *-*-vxworks*] } {
+	    set gc_sections_available_saved 0
+	    return 0
+	}
+
 	# Check if the ld used by gcc supports --gc-sections.
 	set gcc_spec [${tool}_target_compile "-dumpspecs" "" "none" ""]
 	regsub ".*\n\*linker:\[ \t\]*\n(\[^ \t\n\]*).*" "$gcc_spec" {\1} linker


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