From patchwork Sun Jan 9 14:04:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kai Tietz X-Patchwork-Id: 78019 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 3C957B70CD for ; Mon, 10 Jan 2011 01:04:56 +1100 (EST) Received: (qmail 22571 invoked by alias); 9 Jan 2011 14:04:54 -0000 Received: (qmail 22563 invoked by uid 22791); 9 Jan 2011 14:04:53 -0000 X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RFC_ABUSE_POST X-Spam-Check-By: sourceware.org Received: from mail-qw0-f47.google.com (HELO mail-qw0-f47.google.com) (209.85.216.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 09 Jan 2011 14:04:49 +0000 Received: by qwi2 with SMTP id 2so3181561qwi.20 for ; Sun, 09 Jan 2011 06:04:47 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.75.18 with SMTP id w18mr2862420qcj.95.1294581887694; Sun, 09 Jan 2011 06:04:47 -0800 (PST) Received: by 10.229.214.131 with HTTP; Sun, 9 Jan 2011 06:04:47 -0800 (PST) Date: Sun, 9 Jan 2011 15:04:47 +0100 Message-ID: Subject: [patch windows]: Fix regression about -gcoff1 From: Kai Tietz To: GCC Patches Cc: Dave Korn X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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); }