Older versions of GCC emit empty .constructor/.destructor sections
whenever building for C++. In fact, these sections are only used for
kernel mode code - so don't emit them unless that's what we're
building.
gcc/ChangeLog:
2019-10-12 Iain Sandoe <iain@sandoe.co.uk>
* config/darwin.c (darwin_file_end): Only emit empty CTOR/DTOR
sections when building kernel extension code.
From-SVN: r276923
}
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);