From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18119 invoked by alias); 11 Dec 2013 10:50:36 -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 18106 invoked by uid 89); 11 Dec 2013 10:50:36 -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,MSGID_MULTIPLE_AT autolearn=no version=3.3.2 X-HELO: mailhost.u-strasbg.fr Received: from Unknown (HELO mailhost.u-strasbg.fr) (130.79.222.216) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 11 Dec 2013 10:50:34 +0000 Received: from mailhost.u-strasbg.fr (localhost [127.0.0.1]) by antispam (Postfix) with ESMTP id 9291E14013B for ; Wed, 11 Dec 2013 11:50:25 +0100 (CET) Received: from mailhost.u-strasbg.fr (localhost [127.0.0.1]) by antivirus (Postfix) with ESMTP id 833921403CE for ; Wed, 11 Dec 2013 11:50:25 +0100 (CET) Received: from md14.u-strasbg.fr (md14.u-strasbg.fr [130.79.200.249]) by mr6.u-strasbg.fr (Postfix) with ESMTP id 71E2C14013B for ; Wed, 11 Dec 2013 11:50:24 +0100 (CET) Received: from ms17.u-strasbg.fr (ms17.u-strasbg.fr [130.79.204.117]) by md14.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id rBBAoOpW011216 for ; Wed, 11 Dec 2013 11:50:25 +0100 Received: from E6510Muller (gw-ics.u-strasbg.fr [130.79.210.225]) (Authenticated sender: mullerp) by ms17.u-strasbg.fr (Postfix) with ESMTPSA id ECDCD1FD95 for ; Wed, 11 Dec 2013 11:50:23 +0100 (CET) From: "Pierre Muller" To: Subject: [PING RFA] Fix PR 16201: internal error on a cygwin program linked against a DLL with no .data section Date: Wed, 11 Dec 2013 10:50:00 -0000 Message-ID: <004801cef65e$cb82d1b0$62887510$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-SW-Source: 2013-12/txt/msg00421.txt.bz2 Other than adding this issue to the list to be handled before 7.7 release, see: https://sourceware.org/gdb/wiki/GDB_7.7_Release and an answer from Joel stating that he would prefer that someone else with more knowledge about objfile struct would review my RFA... https://sourceware.org/ml/gdb-patches/2013-12/msg00036.html We got no other reaction yet. Should I press Joel to review it nonetheless or does someone else volunteer to review this patch? Pierre >>>>>>>>>>>>>>>>>>>> Original message See discussion in https://sourceware.org/bugzilla/show_bug.cgi?id=16201 The patch below seems to fix the issues as it avoids calling prim_record_minimal_symbol with ms_type argument being equal to mst_XXX (where XXX can be text, data or bss) without having set sect_index_XXX field of the corresponding objfile. Is this OK? Pierre Muller 2013-11-27 Pierre Muller PR 16201 coff-pe-read.c (read_pe_exported_syms): Set sect_index_text, sect_index_data and sect_index_bss of objfile struct, even if there is no canonical '.text', '.data' or '.bss' named section. diff --git a/gdb/coff-pe-read.c b/gdb/coff-pe-read.c index 91ee3f6..954c457 100644 --- a/gdb/coff-pe-read.c +++ b/gdb/coff-pe-read.c @@ -466,6 +466,13 @@ read_pe_exported_syms (struct objfile *objfile) { section_data[sectix].rva_start = vaddr; section_data[sectix].rva_end = vaddr + vsize; + /* Force sect_index, 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 +487,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++;