Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Return-Path: <[email protected]>
- Delivered-To: [email protected]
- Received: from simark.ca
- by simark.ca with LMTP
- id P4sMHZfNb143JgAAWB0awg
- (envelope-from <[email protected]>)
- for <[email protected]>; Mon, 16 Mar 2020 15:03:51 -0400
- Received: by simark.ca (Postfix, from userid 112)
- id 664B71ED42; Mon, 16 Mar 2020 15:03:51 -0400 (EDT)
- X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca
- X-Spam-Level:
- X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3,
- RCVD_IN_MSPIKE_WL,URIBL_BLOCKED autolearn=ham autolearn_force=no
- version=3.4.2
- Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11])
- (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
- (No client certificate requested)
- by simark.ca (Postfix) with ESMTPS id EFE471E5F8
- for <[email protected]>; Mon, 16 Mar 2020 15:03:49 -0400 (EDT)
- Received: from pop3.polymtl.ca (vmmail.polymtl.ca [132.207.4.109])
- by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 02GJ3mHd005320
- (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
- for <[email protected]>; Mon, 16 Mar 2020 15:03:49 -0400
- DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 02GJ3mHd005320
- Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11])
- by pop3.polymtl.ca (8.14.4/8.14.4) with ESMTP id 02GJ3juc018069
- for <[email protected]>; Mon, 16 Mar 2020 15:03:45 -0400
- Received: from sa-prd-fep-041.btinternet.com (mailomta27-sa.btinternet.com [213.120.69.33])
- by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 02GJ3bBK005160
- (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
- for <[email protected]>; Mon, 16 Mar 2020 15:03:43 -0400
- DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 02GJ3bBK005160
- Received: from sa-prd-rgout-004.btmx-prd.synchronoss.net ([10.2.38.7])
- by sa-prd-fep-041.btinternet.com with ESMTP
- id <20200316190337.GKHS1599.sa-prd-fep-041.btinternet.com@sa-prd-rgout-004.btmx-prd.synchronoss.net>;
- Mon, 16 Mar 2020 19:03:37 +0000
- Authentication-Results: btinternet.com;
- auth=pass (PLAIN) [email protected]
- X-Originating-IP: [31.51.205.86]
- X-OWM-Source-IP: 31.51.205.86 (GB)
- X-OWM-Env-Sender: [email protected]
- X-VadeSecure-score: verdict=clean score=0/300, class=clean
- X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgedugedrudeffedguddulecutefuodetggdotefrodftvfcurfhrohhfihhlvgemuceutffkvffkuffjvffgnffgvefqofdpqfgfvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepuffvfhfhkffffgggjggtgfesthejredttdefjeenucfhrhhomheplfhonhcuvfhurhhnvgihuceojhhonhdrthhurhhnvgihsegurhhonhgvtghouggvrdhorhhgrdhukheqnecuffhomhgrihhnpehmihgtrhhoshhofhhtrdgtohhmnecukfhppeefuddrhedurddvtdehrdekieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhephhgvlhhopegludelvddrudeikedruddruddujegnpdhinhgvthepfedurdehuddrvddthedrkeeipdhmrghilhhfrhhomhepoehjohhnrdhtuhhrnhgvhiesughrohhnvggtohguvgdrohhrghdruhhkqecuuefqffgjpeekuefkvffokffogfdprhgtphhtthhopeeoghgusgdqphgrthgthhgvshesshhouhhrtggvfigrrhgvrdhorhhgqedprhgtphhtthhopeeoshhimhhonhdrmhgrrhgthhhisehpohhlhihmthhlrdgtrgeq
- X-RazorGate-Vade-Verdict: clean 0
- X-RazorGate-Vade-Classification: clean
- Received: from [192.168.1.117] (31.51.205.86) by sa-prd-rgout-004.btmx-prd.synchronoss.net (5.8.340) (authenticated as [email protected])
- id 5E3A27DB06397ED9; Mon, 16 Mar 2020 19:03:37 +0000
- Subject: Re: [PATCH 6/7] gdb: select "Cygwin" OS ABI for Cygwin binaries
- To: Simon Marchi <[email protected]>
- References: <[email protected]>
- From: Jon Turney <[email protected]>
- Message-ID: <[email protected]>
- Date: Mon, 16 Mar 2020 19:03:37 +0000
- User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101
- Thunderbird/68.5.0
- MIME-Version: 1.0
- In-Reply-To: <[email protected]>
- Content-Type: text/plain; charset=utf-8; format=flowed
- Content-Language: en-GB
- Content-Transfer-Encoding: 7bit
- X-Poly-FromMTA: (mailomta27-sa.btinternet.com [213.120.69.33]) at Mon, 16 Mar 2020 19:03:38 +0000
- On 16/03/2020 17:08, Simon Marchi wrote:
- > From: Simon Marchi <[email protected]>
- >
- > Before this patch, the "Windows" OS ABI is selected for all Windows
- > executables, including Cygwin ones. This patch makes GDB differentiate
- > Cygwin binaries from non-Cygwin ones, and selects the "Cygwin" OS ABI
- > for the Cygwin ones.
- >
- > To check whether a Windows PE executable is a Cygwin one, we check the
- > library list in the .idata section, see if it contains "cygwin1.dll".
- >
- > I had to add code to parse the .idata section, because BFD doesn't seem
- > to expose this information. BFD does parse this information, but only
- > to print it in textual form (function pe_print_idata):
- >
- [...]
- > +
- > +bool
- > +is_linked_with_cygwin_dll (bfd *abfd)
- > +{
- > + /* The list of DLLs a PE is linked to is in the .idata section. See:
- > +
- > + https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#the-idata-section
- > + */
- > + asection *idata_section = bfd_get_section_by_name (abfd, ".idata");
- > + if (idata_section == nullptr)
- > + return false;
- I'm fine with this as-is, but FTR I think this only happens to work
- because binutils ld (which is probably the only way to currently build a
- cygwin executable) puts the import table in the .idata section.
- The strictly correct way to locate the import table is to use the data
- directory (as pe_print_idata() does)
- (See
- https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#optional-header-data-directories-image-only)
- (Notwithstanding the MS documentation you linked, I believe MS tools can
- put the import table in .rdata)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement