delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/03/17/19:09:17

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:message-id:date:from:mime-version:to:subject
:references:in-reply-to:content-type:content-transfer-encoding;
q=dns; s=default; b=HGDaIF9sklU9FKbKUxwQqq4geMEdYKQUJFI1nEON4ct
hrzigyV2UqfAxfW60dsXStDB6wKowPr8QeDxtAMik2HpK8p25kPwiIIkriu95iBq
7EDbqjKIfiDd6eyhLVp7HxaJjkRcfbKSf6gEkcLrMVKN+L667in4fsszWBA1LPHY
=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:message-id:date:from:mime-version:to:subject
:references:in-reply-to:content-type:content-transfer-encoding;
s=default; bh=EC8Ad+xoPMcnLB7K7iF7POWnkuU=; b=S4j275azl4BrLp9OK
OxelWx3/Q/iBHsAjQTa7vpC+bZqonABlDHqP8GHXZhbMkjlQ6sPVeF6oEa8HVYNk
AcJcxKz+Ceoz1h73ut2pEF9NgvfOKiG3UzkW+RVhmNIkMZbo1+Ra+JLxCKRS4AEi
t6RFKB4Cyvh74KzDyoqMT3HHQA=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=2.1 required=5.0 tests=AWL,BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2
X-HELO: red.contecint.com.au
Message-ID: <53278073.4030909@constrainttec.com>
Date: Tue, 18 Mar 2014 10:08:35 +1100
From: "Sam Liapis AT constrainttec DOT com" <Sam DOT Liapis AT constrainttec DOT com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: 1.7.25, Windows 7: dumper doesn't generate core file
References: <53277ECE DOT 5030003 AT constrainttec DOT com>
In-Reply-To: <53277ECE.5030003@constrainttec.com>
X-Forwarded-Message-Id: <53277ECE DOT 5030003 AT constrainttec DOT com>
X-IsSubscribed: yes

Thanks Christopher - I've since posted to binutils mailing list and had 
a helpful response.

Original post: 
http://lists.gnu.org/archive/html/bug-binutils/2014-03/msg00076.html
      Response: 
http://lists.gnu.org/archive/html/bug-binutils/2014-03/msg00086.html

As you noted and is also clearly implied in feedback memory sections do 
not overlap.

It's verified by examining flags for allegedly overlapping sections 
using objdump utility.
As stated in the response, flags indicate that not all sections may be 
residing in memory.

===========================================================================================================
On Fri, Mar 14, 2014 at 11:15:38AM +1100, Sam address at hidden wrote:
>/  $ objdump -h airdac_.exe/
>/  airdac_.exe:     file format pei-i386/
>/  Sections:/
>/  Idx Name          Size      VMA       LMA       File off  Algn/
>/    0 .text         008d8980  00401000  00401000  00000400  2**4/
>/                    CONTENTS, ALLOC, LOAD, READONLY, CODE, DATA/
>/    .../
>/    7 .debug_info   151e2063  028ca000  028ca000  024b3000  2**0 <==/  /VMA and SIZE match-up with trace above/
>/                    CONTENTS, READONLY, DEBUGGING/

As you can see from the flags above, .debug_info is not ALLOC, LOAD.
This means the section is not loaded into memory and the VMA is
irrelevant.  Another DLL could well occupy this space, because
airdac_.exe does not use that memory.

-- 
Alan Modra
Australia Development Lab, IBM
===========================================================================================================

This raises questions around how dumper determines what sections should 
be excluded.

Dumper does this using the following function inside of 
.../src/winsup/utils/parse_pe.cc:

      ...
      73 select_data_section (bfd * abfd, asection * sect, PTR obj)
      74 {
      75   exclusion *excl_list = (exclusion *) obj;
      76
      77   if ((sect->flags & (SEC_CODE | SEC_DEBUGGING)) &&
      78       sect->vma && bfd_get_section_size (sect))
      79     {
      80       excl_list->add ((LPBYTE) sect->vma, (SIZE_T) 
bfd_get_section_size (sect));
      81       deb_printf ("excluding section: %20s %08lx\n", sect->name,
      82                   bfd_get_section_size (sect));
      83     }
      84 }
      ...

As seen any section which is flagged as either CODE or DEBUGGING is 
excluded from the dump.

Question is should this section test also check if it's resident in 
memory i.e. code mod as follows?

      ...
      77   if ((sect->flags & (SEC_CODE | SEC_DEBUGGING)) &&
      78       (sect->flags & (SEC_LOAD | SEC_ALLOC)) &&            <== 
CODE ADDITION
      79       sect->vma && bfd_get_section_size (sect))
      ...

This would prevent overlaps in excl_list as tested sections resolving 
true would have valid VMAs.

Regards,
Sam


On 12/03/14 15:39, Christopher Faylor wrote:
> On Wed, Mar 12, 2014 at 03:03:52PM +1100, Sam Liapis at constrainttec dot com wrote:
>> Thanks Corinna I appreciate the response.
>>
>>>> Question 2: IS THE CODE MODIFICATION AN ACCEPTABLE SOLUTION TO THE PROBLEM?
>>   > Maybe, but first it would be helpful if somebody could explain why
>>   > sections should be able to overlap at all. That's puzzling me.
>>   >
>>   > As for patches, did you seehttp://cygwin.com/contrib.html
>>   > For small, obvious patches, we don't need the copyright assignment.
>>   > Rule of thumb is < 10 lines.
>>
>>
>>      I'm happy to submit minor patches on both points covered in the original post.
>>      However as you noted I'll wait for someone to first explain if/why sections overlap.
> I doubt we'll get an answer here.  Possibly someone in the binutils mailing
> list would know but I think it's probably safe to assume that sections don't overlap.
>
> cgf
>
> --
> Problem reports:http://cygwin.com/problems.html
> FAQ:http://cygwin.com/faq/
> Documentation:http://cygwin.com/docs.html
> Unsubscribe info:http://cygwin.com/ml/#unsubscribe-simple
>

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019