aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/config/darwin.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
index 539ef75..ddce9f8 100644
--- a/gcc/config/darwin.c
+++ b/gcc/config/darwin.c
@@ -2931,8 +2931,9 @@ darwin_file_end (void)
}
machopic_finish (asm_out_file);
- if (lang_GNU_CXX ())
+ if (flag_apple_kext)
{
+ /* These sections are only used for kernel code. */
switch_to_section (darwin_sections[constructor_section]);
switch_to_section (darwin_sections[destructor_section]);
ASM_OUTPUT_ALIGN (asm_out_file, 1);