Patchwork Fix anonymous code atoms problem on Darwin.

login
register
mail settings
Submitter IainS
Date Dec. 20, 2010, 11:07 a.m.
Message ID <217CD416-F4B9-4F82-AF96-0820498443DB@sandoe-acoustics.co.uk>
Download mbox | patch
Permalink /patch/76184/
State New
Headers show

Comments

IainS - Dec. 20, 2010, 11:07 a.m.
Hi,

This problem became apparent during the resolution of PR46904/46916  
(we have had to switch off freorder-and-partition to avoid regression).

--

Darwin's toolchain will not allow us to have code fragments that are  
anonymous (i.e. isolated by section and preceded only by a local label).

The rule [as quoted by Mike] is:
All sections have zero or more atoms.  An atom is 1 or more bytes with  
a label (non-L) on the front of it.

function reordering or partitioning breaks this, manifesting in linker  
warnings and non-functional debug.

The following patch creates and calls a target hook after mid-function  
section switches that gives the target an opportunity to do whatever  
is necessary to avoid orphan code fragments.  The darwin  
implementation of the hook post-fixes the function name with _$hot$ or  
_$cold$ as appropriate.

OK for trunk?
Iain

gcc:

	* target.def (function_switched_text_sections): New Hook.
	* doc/tm.texi Regenerated.
	* doc/tm.texi.in (TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS)
	New.
	* final.c (default_function_switched_text_sections): New.
	(final_scan_insn): Call function_switched_text_sections when a mid- 
function section
	change occurs.
	* output.h (default_function_switched_text_sections): Declare.
	* config/darwin-protos.h (darwin_function_switched_text_sections) :  
Likewise.
	* config/darwin.c (darwin_function_switched_text_sections): New.
	* config/darwin.h (TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS)
	New.
Richard Henderson - Dec. 20, 2010, 9:18 p.m.
On 12/20/2010 03:07 AM, IainS wrote:
>     * target.def (function_switched_text_sections): New Hook.
>     * doc/tm.texi Regenerated.
>     * doc/tm.texi.in (TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS)
>     New.
>     * final.c (default_function_switched_text_sections): New.
>     (final_scan_insn): Call function_switched_text_sections when a mid-function section
>     change occurs.
>     * output.h (default_function_switched_text_sections): Declare.
>     * config/darwin-protos.h (darwin_function_switched_text_sections) : Likewise.
>     * config/darwin.c (darwin_function_switched_text_sections): New.
>     * config/darwin.h (TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS)
>     New.

Ok by me, assuming Mike is ok with it.


r~
Mike Stump - Dec. 23, 2010, 7:43 p.m.
On Dec 20, 2010, at 3:07 AM, IainS <developer@sandoe-acoustics.co.uk> wrote:
> This problem became apparent during the resolution of PR46904/46916 (we have had to switch off freorder-and-partition to avoid regression).

> The darwin implementation of the hook post-fixes the function name with _$hot$ or _$cold$ as appropriate.
> 
> OK for trunk?

Ok with one change, don't use $ in label names.
IainS - Jan. 7, 2011, 2:02 p.m.
On 23 Dec 2010, at 19:43, Mike Stump wrote:

> On Dec 20, 2010, at 3:07 AM, IainS <developer@sandoe- 
> acoustics.co.uk> wrote:
>> This problem became apparent during the resolution of PR46904/46916  
>> (we have had to switch off freorder-and-partition to avoid  
>> regression).
>
>> The darwin implementation of the hook post-fixes the function name  
>> with _$hot$ or _$cold$ as appropriate.
>>
>> OK for trunk?
>
> Ok with one change, don't use $ in label names.

ci r168571 - as attached,
includes a partial reversion of a previous patch (which disabled - 
freorder-and-partition).
  -freorder-and-partition is now active on Darwin >=  9.
Iain
cat <<'EOF' |
LAST_UPDATED: Fri Jan  7 08:22:30 UTC 2011 (revision 168562)

Native configuration is i686-apple-darwin9

		=== g++ tests ===


Running target unix/-m32
UNRESOLVED: g++.dg/ext/label13.C compilation failed to produce executable
FAIL: g++.dg/torture/stackalign/eh-alloca-1.C  -O3 -g  execution test
FAIL: g++.dg/torture/stackalign/eh-vararg-1.C  -O3 -g  execution test
FAIL: g++.dg/torture/stackalign/eh-vararg-2.C  -O3 -g  execution test
FAIL: g++.dg/torture/stackalign/eh-alloca-1.C  -O3 -g  execution test
FAIL: g++.dg/torture/stackalign/eh-vararg-1.C  -O3 -g  execution test
FAIL: g++.dg/torture/stackalign/eh-vararg-2.C  -O3 -g  execution test

		=== g++ Summary for unix/-m32 ===

# of expected passes		26234
# of unexpected failures	6
# of expected failures		159
# of unresolved testcases	1
# of unsupported tests		179

Running target unix/-m64
UNRESOLVED: g++.dg/ext/label13.C compilation failed to produce executable

		=== g++ Summary for unix/-m64 ===

# of expected passes		26472
# of expected failures		159
# of unresolved testcases	1
# of unsupported tests		378

		=== g++ Summary ===

# of expected passes		52706
# of unexpected failures	6
# of expected failures		318
# of unresolved testcases	2
# of unsupported tests		557
/Volumes/ScratchCS/gcc-4-6-reghunt-build/gcc/testsuite/g++/../../g++  version 4.6.0 20110107 (experimental) [trunk revision 168562] (GCC) 

		=== gcc tests ===


Running target unix/-m32
FAIL: gcc.c-torture/execute/20040811-1.c compilation,  -O3 -g 
UNRESOLVED: gcc.c-torture/execute/20040811-1.c execution,  -O3 -g 
FAIL: gcc.c-torture/execute/pr43220.c compilation,  -O3 -g 
UNRESOLVED: gcc.c-torture/execute/pr43220.c execution,  -O3 -g 
FAIL: gcc.c-torture/execute/vla-dealloc-1.c compilation,  -O3 -g 
UNRESOLVED: gcc.c-torture/execute/vla-dealloc-1.c execution,  -O3 -g 
XPASS: gcc.dg/tree-ssa/20040204-1.c scan-tree-dump-times optimized "link_error" 0
FAIL: gcc.target/i386/combine-mul.c scan-assembler-not 12345

		=== gcc Summary for unix/-m32 ===

# of expected passes		73632
# of unexpected failures	4
# of unexpected successes	1
# of expected failures		212
# of unresolved testcases	3
# of unsupported tests		1364

Running target unix/-m64
XPASS: gcc.dg/tree-ssa/20040204-1.c scan-tree-dump-times optimized "link_error" 0
FAIL: gcc.target/i386/combine-mul.c scan-assembler-not 12345

		=== gcc Summary for unix/-m64 ===

# of expected passes		73769
# of unexpected failures	1
# of unexpected successes	1
# of expected failures		213
# of unsupported tests		1741

		=== gcc Summary ===

# of expected passes		147401
# of unexpected failures	5
# of unexpected successes	2
# of expected failures		425
# of unresolved testcases	3
# of unsupported tests		3105
/Volumes/ScratchCS/gcc-4-6-reghunt-build/gcc/xgcc  version 4.6.0 20110107 (experimental) [trunk revision 168562] (GCC) 

		=== gfortran tests ===


Running target unix/-m32
XPASS: gfortran.dg/pr25923.f90  -O  PR45505 (test for warnings, line 13)
XPASS: gfortran.dg/pr25923.f90  -O  PR45505 (test for bogus messages, line 22)

		=== gfortran Summary for unix/-m32 ===

# of expected passes		37483
# of unexpected successes	2
# of expected failures		48
# of unsupported tests		181

Running target unix/-m64

		=== gfortran Summary for unix/-m64 ===

# of expected passes		37726
# of expected failures		48
# of unsupported tests		65

		=== gfortran Summary ===

# of expected passes		75209
# of unexpected successes	2
# of expected failures		96
# of unsupported tests		246
/Volumes/ScratchCS/gcc-4-6-reghunt-build/gcc/testsuite/gfortran/../../gfortran  version 4.6.0 20110107 (experimental) [trunk revision 168562] (GCC) 

		=== obj-c++ tests ===


Running target unix/-m32
UNRESOLVED: obj-c++.dg/try-catch-2.mm -fgnu-runtime compilation failed to produce executable
UNRESOLVED: obj-c++.dg/try-catch-9.mm -fgnu-runtime compilation failed to produce executable

		=== obj-c++ Summary for unix/-m32 ===

# of expected passes		2945
# of expected failures		2
# of unresolved testcases	2
# of unsupported tests		68

Running target unix/-m64
UNRESOLVED: obj-c++.dg/try-catch-2.mm -fgnu-runtime compilation failed to produce executable
UNRESOLVED: obj-c++.dg/try-catch-9.mm -fgnu-runtime compilation failed to produce executable
UNRESOLVED: obj-c++.dg/try-catch-2.mm -fnext-runtime compilation failed to produce executable
UNRESOLVED: obj-c++.dg/try-catch-9.mm -fnext-runtime compilation failed to produce executable

		=== obj-c++ Summary for unix/-m64 ===

# of expected passes		2780
# of expected failures		131
# of unresolved testcases	4
# of unsupported tests		73

		=== obj-c++ Summary ===

# of expected passes		5725
# of expected failures		133
# of unresolved testcases	6
# of unsupported tests		141
/Volumes/ScratchCS/gcc-4-6-reghunt-build/gcc/testsuite/obj-c++/../../g++  version 4.6.0 20110107 (experimental) [trunk revision 168562] (GCC) 

		=== objc tests ===


Running target unix/-m32
XPASS: objc.dg-struct-layout-encoding-1/t026_main.m execution test

		=== objc Summary for unix/-m32 ===

# of expected passes		5890
# of unexpected successes	1
# of expected failures		6
# of unsupported tests		86

Running target unix/-m64
XPASS: objc.dg-struct-layout-encoding-1/t026_main.m execution test

		=== objc Summary for unix/-m64 ===

# of expected passes		4507
# of unexpected successes	1
# of expected failures		161
# of unsupported tests		102

		=== objc Summary ===

# of expected passes		10397
# of unexpected successes	2
# of expected failures		167
# of unsupported tests		188
/Volumes/ScratchCS/gcc-4-6-reghunt-build/gcc/xgcc  version 4.6.0 20110107 (experimental) [trunk revision 168562] (GCC) 

		=== libffi tests ===


Running target unix/-m32

		=== libffi Summary for unix/-m32 ===

# of expected passes		1634
# of expected failures		10
# of unsupported tests		15

Running target unix/-m64

		=== libffi Summary for unix/-m64 ===

# of expected passes		1634
# of expected failures		10
# of unsupported tests		15

		=== libffi Summary ===

# of expected passes		3268
# of expected failures		20
# of unsupported tests		30
		=== libgomp tests ===


Running target unix/-m32

		=== libgomp Summary for unix/-m32 ===

# of expected passes		2522
# of unsupported tests		2

Running target unix/-m64

		=== libgomp Summary for unix/-m64 ===

# of expected passes		2522
# of unsupported tests		2

		=== libgomp Summary ===

# of expected passes		5044
# of unsupported tests		4
		=== libjava tests ===


Running target unix/-m32

		=== libjava Summary for unix/-m32 ===

# of expected passes		2574

Running target unix/-m64
FAIL: PR16923 run

		=== libjava Summary for unix/-m64 ===

# of expected passes		2573
# of unexpected failures	1
# of untested testcases		1

		=== libjava Summary ===

# of expected passes		5147
# of unexpected failures	1
# of untested testcases		1
		=== libstdc++ tests ===


Running target unix/-m32
FAIL: ext/mt_allocator/deallocate_global_thread-1.cc execution test
FAIL: ext/mt_allocator/deallocate_global_thread-3.cc execution test

		=== libstdc++ Summary for unix/-m32 ===

# of expected passes		6978
# of unexpected failures	2
# of expected failures		83
# of unsupported tests		651

Running target unix/-m64
FAIL: ext/mt_allocator/deallocate_global_thread-1.cc execution test
FAIL: ext/mt_allocator/deallocate_global_thread-3.cc execution test

		=== libstdc++ Summary for unix/-m64 ===

# of expected passes		6976
# of unexpected failures	2
# of expected failures		83
# of unsupported tests		652

		=== libstdc++ Summary ===

# of expected passes		13954
# of unexpected failures	4
# of expected failures		166
# of unsupported tests		1303

		=== libstdc++ Summary ===


Compiler version: 4.6.0 20110107 (experimental) [trunk revision 168562] (GCC) 
Platform: i686-apple-darwin9
configure flags: --prefix=/GCC/gcc-4-6-rh-install --target=i686-apple-darwin9 --host=i686-apple-darwin9 --build=i686-apple-darwin9 --enable-version-specific-runtime-libs --enable-threads --enable-checking=yes --program-suffix=-4.6trunk --with-libiconv-prefix=/usr --with-system-zlib --with-gmp=/GCC/multiprec-math/x86 --with-mpfr=/GCC/multiprec-math/x86 --with-mpc=/GCC/multiprec-math/x86 --enable-languages=c,lto,c++,objc,obj-c++,fortran,java CC=gcc-4.2 CXX=g++-4.2
EOF
Mail -s "Results for 4.6.0 20110107 (experimental) [trunk revision 168562] (GCC) testsuite on i686-apple-darwin9" gcc-testresults@gcc.gnu.org &&
mv /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/g++/g++.sum /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/g++/g++.sum.sent &&
mv /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/gcc/gcc.sum /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/gcc/gcc.sum.sent &&
mv /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/gfortran/gfortran.sum /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/gfortran/gfortran.sum.sent &&
mv /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/obj-c++/obj-c++.sum /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/obj-c++/obj-c++.sum.sent &&
mv /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/objc/objc.sum /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/objc/objc.sum.sent &&
mv /GCC/gcc-4-6-reghunt-build/./i686-apple-darwin9/libffi/testsuite/libffi.sum /GCC/gcc-4-6-reghunt-build/./i686-apple-darwin9/libffi/testsuite/libffi.sum.sent &&
mv /GCC/gcc-4-6-reghunt-build/./i686-apple-darwin9/libgomp/testsuite/libgomp.sum /GCC/gcc-4-6-reghunt-build/./i686-apple-darwin9/libgomp/testsuite/libgomp.sum.sent &&
mv /GCC/gcc-4-6-reghunt-build/./i686-apple-darwin9/libjava/testsuite/libjava.sum /GCC/gcc-4-6-reghunt-build/./i686-apple-darwin9/libjava/testsuite/libjava.sum.sent &&
mv /GCC/gcc-4-6-reghunt-build/./i686-apple-darwin9/libstdc++-v3/testsuite/libstdc++.sum /GCC/gcc-4-6-reghunt-build/./i686-apple-darwin9/libstdc++-v3/testsuite/libstdc++.sum.sent &&
mv /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/g++/g++.log /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/g++/g++.log.sent &&
mv /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/gcc/gcc.log /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/gcc/gcc.log.sent &&
mv /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/gfortran/gfortran.log /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/gfortran/gfortran.log.sent &&
mv /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/obj-c++/obj-c++.log /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/obj-c++/obj-c++.log.sent &&
mv /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/objc/objc.log /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/objc/objc.log.sent &&
mv /GCC/gcc-4-6-reghunt-build/./i686-apple-darwin9/libffi/testsuite/libffi.log /GCC/gcc-4-6-reghunt-build/./i686-apple-darwin9/libffi/testsuite/libffi.log.sent &&
mv /GCC/gcc-4-6-reghunt-build/./i686-apple-darwin9/libgomp/testsuite/libgomp.log /GCC/gcc-4-6-reghunt-build/./i686-apple-darwin9/libgomp/testsuite/libgomp.log.sent &&
mv /GCC/gcc-4-6-reghunt-build/./i686-apple-darwin9/libjava/testsuite/libjava.log /GCC/gcc-4-6-reghunt-build/./i686-apple-darwin9/libjava/testsuite/libjava.log.sent &&
mv /GCC/gcc-4-6-reghunt-build/./i686-apple-darwin9/libstdc++-v3/testsuite/libstdc++.log /GCC/gcc-4-6-reghunt-build/./i686-apple-darwin9/libstdc++-v3/testsuite/libstdc++.log.sent &&
true
Mike Stump - Feb. 8, 2011, 3:01 a.m.
On Dec 20, 2010, at 3:07 AM, IainS wrote:
> This problem became apparent during the resolution of PR46904/46916 (we have had to switch off freorder-and-partition to avoid regression).

> gcc:
> 
> 	* target.def (function_switched_text_sections): New Hook.
> 	* doc/tm.texi Regenerated.
> 	* doc/tm.texi.in (TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS)
> 	New.
> 	* final.c (default_function_switched_text_sections): New.
> 	(final_scan_insn): Call function_switched_text_sections when a mid-function section
> 	change occurs.
> 	* output.h (default_function_switched_text_sections): Declare.
> 	* config/darwin-protos.h (darwin_function_switched_text_sections) : Likewise.
> 	* config/darwin.c (darwin_function_switched_text_sections): New.
> 	* config/darwin.h (TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS)
> 	New.

This posted patch does not match what was checked in r168571.  Could you please audit what was checked in and ensure it is as you wanted.  Thanks.

Patch

Index: gcc/target.def
===================================================================
--- gcc/target.def	(revision 168084)
+++ gcc/target.def	(working copy)
@@ -294,6 +294,17 @@  DEFHOOK
  section *, (tree decl, enum node_frequency freq, bool startup, bool exit),
  default_function_section)
 
+/* Output the assembler code for function exit.  */
+DEFHOOK
+(function_switched_text_sections,
+ "Used by the target to emit any assembler directives or additional\
+  labels needed when a function is partitioned between different\
+  sections.  Output should be written to @var{file}.  The function\
+  decl is available as @var{decl} and the new section is `cold' if\
+  @var{new_is_cold} is @code{true}.",
+ void, (FILE *file, tree decl, bool new_is_cold),
+ default_function_switched_text_sections)
+
 /* Return a mask describing how relocations should be treated when
    selecting sections.  Bit 1 should be set if global relocations
    should be placed in a read-write section; bit 0 should be set if
Index: gcc/doc/tm.texi
===================================================================
--- gcc/doc/tm.texi	(revision 168084)
+++ gcc/doc/tm.texi	(working copy)
@@ -7325,6 +7325,10 @@  at startup (from static constructors or it is @cod
 Return NULL if function should go to default text section.
 @end deftypefn
 
+@deftypefn {Target Hook} void TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS (FILE *@var{file}, tree @var{decl}, bool @var{new_is_cold})
+Used by the target to emit any assembler directives or additional  labels needed when a function is partitioned between different  sections.  Output should be written to @var{file}.  The function  decl is available as @var{decl} and the new section is `cold' if  @var{new_is_cold} is @code{true}.
+@end deftypefn
+
 @deftypevr {Target Hook} bool TARGET_HAVE_NAMED_SECTIONS
 This flag is true if the target supports @code{TARGET_ASM_NAMED_SECTION}.
 It must not be modified by command-line option processing.
Index: gcc/doc/tm.texi.in
===================================================================
--- gcc/doc/tm.texi.in	(revision 168084)
+++ gcc/doc/tm.texi.in	(working copy)
@@ -7298,6 +7298,8 @@  at startup (from static constructors or it is @cod
 Return NULL if function should go to default text section.
 @end deftypefn
 
+@hook TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS
+
 @hook TARGET_HAVE_NAMED_SECTIONS
 This flag is true if the target supports @code{TARGET_ASM_NAMED_SECTION}.
 It must not be modified by command-line option processing.
Index: gcc/final.c
===================================================================
--- gcc/final.c	(revision 168084)
+++ gcc/final.c	(working copy)
@@ -256,6 +256,13 @@  default_function_pro_epilogue (FILE *file ATTRIBUT
 {
 }
 
+void
+default_function_switched_text_sections (FILE *file ATTRIBUTE_UNUSED,
+					 tree decl ATTRIBUTE_UNUSED,
+					 bool new_is_cold ATTRIBUTE_UNUSED)
+{
+}
+
 /* Default target hook that outputs nothing to a stream.  */
 void
 no_asm_to_stream (FILE *file ATTRIBUTE_UNUSED)
@@ -1841,6 +1848,9 @@  final_scan_insn (rtx insn, FILE *file, int optimiz
 	    debug_hooks->switch_text_section ();
 
 	  switch_to_section (current_function_section ());
+	  targetm.asm_out.function_switched_text_sections (asm_out_file,
+							   current_function_decl,
+							   in_cold_section_p);
 	  break;
 
 	case NOTE_INSN_BASIC_BLOCK:
Index: gcc/output.h
===================================================================
--- gcc/output.h	(revision 168084)
+++ gcc/output.h	(working copy)
@@ -417,6 +417,9 @@  extern const char *user_label_prefix;
 /* Default target function prologue and epilogue assembler output.  */
 extern void default_function_pro_epilogue (FILE *, HOST_WIDE_INT);
 
+/* Default target function switched text sections.  */
+extern void default_function_switched_text_sections (FILE *, tree, bool);
+
 /* Default target hook that outputs nothing to a stream.  */
 extern void no_asm_to_stream (FILE *);
 
Index: gcc/config/darwin-protos.h
===================================================================
--- gcc/config/darwin-protos.h	(revision 168084)
+++ gcc/config/darwin-protos.h	(working copy)
@@ -58,6 +58,8 @@  extern section *machopic_select_rtx_section (enum
 					     unsigned HOST_WIDE_INT);
 
 extern section *darwin_function_section (tree, enum node_frequency, bool, bool); 
+extern void darwin_function_switched_text_sections (FILE *, tree, bool);
+
 extern void darwin_unique_section (tree decl, int reloc);
 extern void darwin_asm_named_section (const char *, unsigned int, tree);
 extern void darwin_non_lazy_pcrel (FILE *, rtx);
Index: gcc/config/darwin.c
===================================================================
--- gcc/config/darwin.c	(revision 168084)
+++ gcc/config/darwin.c	(working copy)
@@ -3066,4 +3047,22 @@  darwin_function_section (tree decl, enum node_freq
     }
 }
 
+/* When a function is partitioned between sections, we need to insert a label
+   at the start of each new chunk - so that it may become a valid 'atom' for
+   eh and debug purposes.  Without this the linker will emit warnings if one 
+   tries to add line location information (since the switched fragment will 
+   be anonymous).  */
+
+void
+darwin_function_switched_text_sections (FILE *fp, tree decl, bool new_is_cold)
+{
+  char buf[128];
+  snprintf (buf, 128, "%s%s",
+	    IDENTIFIER_POINTER (DECL_NAME (decl)),
+	    new_is_cold?"_$cold$":"_$hot$");
+  /* Make sure we pick up all the relevant quotes etc.  */
+  assemble_name_raw (fp, (const char *) buf);
+  fputs (":\n", fp);
+}
+
 #include "gt-darwin.h"
Index: gcc/config/darwin.h
===================================================================
--- gcc/config/darwin.h	(revision 168084)
+++ gcc/config/darwin.h	(working copy)
@@ -673,6 +673,10 @@  extern GTY(()) section * darwin_sections[NUM_DARWI
 #undef	TARGET_ASM_FUNCTION_SECTION
 #define TARGET_ASM_FUNCTION_SECTION darwin_function_section
 
+#undef	TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS
+#define TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS \
+	darwin_function_switched_text_sections
+
 #undef	TARGET_ASM_SELECT_RTX_SECTION
 #define TARGET_ASM_SELECT_RTX_SECTION machopic_select_rtx_section
 #undef  TARGET_ASM_UNIQUE_SECTION