public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PING RFA] Fix PR 16201: internal error on a cygwin program linked against a DLL with no .data section
@ 2013-12-11 10:50 Pierre Muller
  2013-12-11 17:02 ` Joel Brobecker
  0 siblings, 1 reply; 11+ messages in thread
From: Pierre Muller @ 2013-12-11 10:50 UTC (permalink / raw)
  To: gdb-patches

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  <muller@sourceware.org>

        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++;

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-01-07 23:40 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-11 10:50 [PING RFA] Fix PR 16201: internal error on a cygwin program linked against a DLL with no .data section Pierre Muller
2013-12-11 17:02 ` Joel Brobecker
2013-12-13 21:40   ` [RFA-v2] " Pierre Muller
2013-12-18  3:55     ` Joel Brobecker
     [not found]   ` <52ab7ec0.c8da420a.12c6.ffffb3f4SMTPIN_ADDED_BROKEN@mx.google.com>
2013-12-20 18:19     ` Pedro Alves
2013-12-22 22:56       ` Pierre Muller
     [not found]       ` <15250.2735647888$1387752987@news.gmane.org>
2013-12-23  2:31         ` asmwarrior
     [not found]       ` <52b76e14.8886420a.29e6.ffffddb2SMTPIN_ADDED_BROKEN@mx.google.com>
2014-01-06 18:34         ` Pedro Alves
2014-01-07 11:15           ` [RFA-v3] " Pierre Muller
     [not found]           ` <52cbe1c5.67ed440a.67e6.7288SMTPIN_ADDED_BROKEN@mx.google.com>
2014-01-07 20:58             ` Pedro Alves
2014-01-07 23:40               ` [COMMIT-v4] " Pierre Muller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).