From patchwork Sun Jan 9 14:04:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [windows] : Fix regression about -gcoff1 From: Kai Tietz X-Patchwork-Id: 78019 Message-Id: To: GCC Patches Cc: Dave Korn Date: Sun, 9 Jan 2011 15:04:47 +0100 Hello, While running g++.dg/debug testsuite I noticed regression about -gcoff1 and wrong section use. The coff1 debugging information changes section to .text and doesn't restore it back to function decl's section. This is cause that function gets placed within wrong section. 2011-01-09 Kai Tietz * config/i386/winnt.c (i386_pe_start_function): Make sure to switch back to function's section. Tested for x86_64-w64-mingw32 and i686-pc-mingw32. I'll apply it in a couple of hours if there are no objections. Regards, Kai Index: winnt.c =================================================================== --- winnt.c (revision 168611) +++ winnt.c (working copy) @@ -1101,6 +1101,9 @@ i386_pe_maybe_record_exported_symbol (decl, name, 0); if (write_symbols != SDB_DEBUG) i386_pe_declare_function_type (f, name, TREE_PUBLIC (decl)); + /* In case section was altered by debugging output. */ + if (decl != NULL_TREE) + switch_to_section (function_section (decl)); ASM_OUTPUT_FUNCTION_LABEL (f, name, decl); }