From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29111 invoked by alias); 18 Dec 2013 03:55:09 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 29082 invoked by uid 89); 18 Dec 2013 03:55:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 18 Dec 2013 03:55:02 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id DD456116794; Tue, 17 Dec 2013 22:55:40 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id VYQ-N+cpG0Pm; Tue, 17 Dec 2013 22:55:40 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 6EF5411652F; Tue, 17 Dec 2013 22:55:40 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 03B62E0694; Wed, 18 Dec 2013 07:54:55 +0400 (RET) Date: Wed, 18 Dec 2013 03:55:00 -0000 From: Joel Brobecker To: Pierre Muller Cc: gdb-patches@sourceware.org Subject: Re: [RFA-v2] Fix PR 16201: internal error on a cygwin program linked against a DLL with no .data section Message-ID: <20131218035455.GA977@adacore.com> References: <004801cef65e$cb82d1b0$62887510$@muller@ics-cnrs.unistra.fr> <20131211170204.GD3227@adacore.com> <001501cef84b$e20dbd70$a6293850$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <001501cef84b$e20dbd70$a6293850$@muller@ics-cnrs.unistra.fr> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2013-12/txt/msg00685.txt.bz2 > 2013-12-13 Pierre Muller > > Fix PR16201. > coff-pe-read.c (read_pe_exported_syms): Set OBJFILE->sect_index_XXX > for XXX text, data or bss to any section that sets ms_type > field of section_data to mst_XXX, with preference > to canonical names '.text', '.data' and '.bss'. It's been a month since you posted the patch, and no one but me really commented on it. Since we need this before branching for 7.7, and since I do not see anything obviously wrong with it, I will give it the OK. Let's wait until Friday to commit, in order to give anyone else a last chance to comment, but otherwise, my only request is that you expand the comment you added to explain __why__ you set the various sect_index_XXX fields, especially since you do it even when already set. Only nit-picking request is also that it would be nice if the comment was formatted so that line lengths would be closer to 70 - while most people tend to write lines that are too long, you seem to be to the opposite :). Thank you! > diff --git a/gdb/coff-pe-read.c b/gdb/coff-pe-read.c > index 91ee3f6..ec9aed5 100644 > --- a/gdb/coff-pe-read.c > +++ b/gdb/coff-pe-read.c > @@ -466,6 +466,15 @@ read_pe_exported_syms (struct objfile *objfile) > { > section_data[sectix].rva_start = vaddr; > section_data[sectix].rva_end = vaddr + vsize; > + /* For .text, .data and .bss section > + set corresponding sect_index_XXX, > + even if it was already set before. */ > + if (sectix == PE_SECTION_INDEX_TEXT) > + objfile->sect_index_text = sectix; > + if (sectix == PE_SECTION_INDEX_DATA) > + objfile->sect_index_data = sectix; > + if (sectix == PE_SECTION_INDEX_BSS) > + objfile->sect_index_bss = sectix; > } > else > { > @@ -480,11 +489,23 @@ read_pe_exported_syms (struct objfile *objfile) > section_data[otherix].rva_end = vaddr + vsize; > section_data[otherix].vma_offset = 0; > if (characteristics & IMAGE_SCN_CNT_CODE) > - section_data[otherix].ms_type = mst_text; > + { > + section_data[otherix].ms_type = mst_text; > + if (objfile->sect_index_text == -1) > + objfile->sect_index_text = otherix; > + } > else if (characteristics & IMAGE_SCN_CNT_INITIALIZED_DATA) > - section_data[otherix].ms_type = mst_data; > + { > + section_data[otherix].ms_type = mst_data; > + if (objfile->sect_index_data == -1) > + objfile->sect_index_data = otherix; > + } > else if (characteristics & IMAGE_SCN_CNT_UNINITIALIZED_DATA) > - section_data[otherix].ms_type = mst_bss; > + { > + section_data[otherix].ms_type = mst_bss; > + if (objfile->sect_index_bss == -1) > + objfile->sect_index_bss = otherix; > + } > else > section_data[otherix].ms_type = mst_unknown; > otherix++; -- Joel