public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Pierre Muller <pierre.muller@ics-cnrs.unistra.fr>
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
Date: Wed, 18 Dec 2013 03:55:00 -0000	[thread overview]
Message-ID: <20131218035455.GA977@adacore.com> (raw)
In-Reply-To: <001501cef84b$e20dbd70$a6293850$@muller@ics-cnrs.unistra.fr>

> 2013-12-13  Pierre Muller  <muller@sourceware.org>
> 
>         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

  reply	other threads:[~2013-12-18  3:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-11 10:50 [PING RFA] " 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 [this message]
     [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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131218035455.GA977@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pierre.muller@ics-cnrs.unistra.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).