From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19388 invoked by alias); 6 Jan 2014 18:34:16 -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 19375 invoked by uid 89); 6 Jan 2014 18:34:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 06 Jan 2014 18:34:13 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s06IY7qB005072 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 6 Jan 2014 13:34:07 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s06IY5EX019608; Mon, 6 Jan 2014 13:34:06 -0500 Message-ID: <52CAF71D.3050008@redhat.com> Date: Mon, 06 Jan 2014 18:34:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Pierre Muller CC: "'Joel Brobecker'" , 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 References: <004801cef65e$cb82d1b0$62887510$@muller@ics-cnrs.unistra.fr> <20131211170204.GD3227@adacore.com> <52ab7ec0.c8da420a.12c6.ffffb3f4SMTPIN_ADDED_BROKEN@mx.google.com> <52B48A28.2000402@redhat.com> <52b76e14.8886420a.29e6.ffffddb2SMTPIN_ADDED_BROKEN@mx.google.com> In-Reply-To: <52b76e14.8886420a.29e6.ffffddb2SMTPIN_ADDED_BROKEN@mx.google.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-01/txt/msg00080.txt.bz2 Hi Pierre, Sorry for the slow reply. Been away on vacation. On 12/22/2013 10:55 PM, Pierre Muller wrote: > @@ -455,17 +458,34 @@ read_pe_exported_syms (struct objfile *objfile) > unsigned long characteristics = pe_get32 (dll, secptr1 + 36); > char sec_name[SCNNMLEN + 1]; > int sectix; > + unsigned int bfd_section_index; > + asection *section; > > bfd_seek (dll, (file_ptr) secptr1 + 0, SEEK_SET); > bfd_bread (sec_name, (bfd_size_type) SCNNMLEN, dll); > sec_name[SCNNMLEN] = '\0'; > > sectix = read_pe_section_index (sec_name); > + section = bfd_get_section_by_name (dll, sec_name); Can't coff have sections with duplicate names? If so, then it'd be better to match the section some other way, I guess by address? > + if (section) > + bfd_section_index = section->index; > + else > + bfd_section_index = -1; > > if (sectix != PE_SECTION_INDEX_INVALID) > { > 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; > + section_data[sectix].index = bfd_section_index; Do you still need this part? > } -- Pedro Alves