Advertisement
Guest User

Untitled

a guest
Mar 16th, 2020
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.76 KB | None | 0 0
  1. Return-Path: <[email protected]>
  2. Delivered-To: [email protected]
  3. Received: from simark.ca
  4. by simark.ca with LMTP
  5. id P4sMHZfNb143JgAAWB0awg
  6. (envelope-from <[email protected]>)
  7. for <[email protected]>; Mon, 16 Mar 2020 15:03:51 -0400
  8. Received: by simark.ca (Postfix, from userid 112)
  9. id 664B71ED42; Mon, 16 Mar 2020 15:03:51 -0400 (EDT)
  10. X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca
  11. X-Spam-Level:
  12. X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3,
  13. RCVD_IN_MSPIKE_WL,URIBL_BLOCKED autolearn=ham autolearn_force=no
  14. version=3.4.2
  15. Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11])
  16. (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
  17. (No client certificate requested)
  18. by simark.ca (Postfix) with ESMTPS id EFE471E5F8
  19. for <[email protected]>; Mon, 16 Mar 2020 15:03:49 -0400 (EDT)
  20. Received: from pop3.polymtl.ca (vmmail.polymtl.ca [132.207.4.109])
  21. by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 02GJ3mHd005320
  22. (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
  23. for <[email protected]>; Mon, 16 Mar 2020 15:03:49 -0400
  24. DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 02GJ3mHd005320
  25. Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11])
  26. by pop3.polymtl.ca (8.14.4/8.14.4) with ESMTP id 02GJ3juc018069
  27. for <[email protected]>; Mon, 16 Mar 2020 15:03:45 -0400
  28. Received: from sa-prd-fep-041.btinternet.com (mailomta27-sa.btinternet.com [213.120.69.33])
  29. by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 02GJ3bBK005160
  30. (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
  31. for <[email protected]>; Mon, 16 Mar 2020 15:03:43 -0400
  32. DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 02GJ3bBK005160
  33. Received: from sa-prd-rgout-004.btmx-prd.synchronoss.net ([10.2.38.7])
  34. by sa-prd-fep-041.btinternet.com with ESMTP
  35. id <20200316190337.GKHS1599.sa-prd-fep-041.btinternet.com@sa-prd-rgout-004.btmx-prd.synchronoss.net>;
  36. Mon, 16 Mar 2020 19:03:37 +0000
  37. Authentication-Results: btinternet.com;
  38. auth=pass (PLAIN) [email protected]
  39. X-Originating-IP: [31.51.205.86]
  40. X-OWM-Source-IP: 31.51.205.86 (GB)
  41. X-OWM-Env-Sender: [email protected]
  42. X-VadeSecure-score: verdict=clean score=0/300, class=clean
  43. X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgedugedrudeffedguddulecutefuodetggdotefrodftvfcurfhrohhfihhlvgemuceutffkvffkuffjvffgnffgvefqofdpqfgfvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepuffvfhfhkffffgggjggtgfesthejredttdefjeenucfhrhhomheplfhonhcuvfhurhhnvgihuceojhhonhdrthhurhhnvgihsegurhhonhgvtghouggvrdhorhhgrdhukheqnecuffhomhgrihhnpehmihgtrhhoshhofhhtrdgtohhmnecukfhppeefuddrhedurddvtdehrdekieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhephhgvlhhopegludelvddrudeikedruddruddujegnpdhinhgvthepfedurdehuddrvddthedrkeeipdhmrghilhhfrhhomhepoehjohhnrdhtuhhrnhgvhiesughrohhnvggtohguvgdrohhrghdruhhkqecuuefqffgjpeekuefkvffokffogfdprhgtphhtthhopeeoghgusgdqphgrthgthhgvshesshhouhhrtggvfigrrhgvrdhorhhgqedprhgtphhtthhopeeoshhimhhonhdrmhgrrhgthhhisehpohhlhihmthhlrdgtrgeq
  44. X-RazorGate-Vade-Verdict: clean 0
  45. X-RazorGate-Vade-Classification: clean
  46. 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])
  47. id 5E3A27DB06397ED9; Mon, 16 Mar 2020 19:03:37 +0000
  48. Subject: Re: [PATCH 6/7] gdb: select "Cygwin" OS ABI for Cygwin binaries
  49. To: Simon Marchi <[email protected]>
  50. References: <[email protected]>
  51. From: Jon Turney <[email protected]>
  52. Message-ID: <[email protected]>
  53. Date: Mon, 16 Mar 2020 19:03:37 +0000
  54. User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101
  55. Thunderbird/68.5.0
  56. MIME-Version: 1.0
  57. In-Reply-To: <[email protected]>
  58. Content-Type: text/plain; charset=utf-8; format=flowed
  59. Content-Language: en-GB
  60. Content-Transfer-Encoding: 7bit
  61. X-Poly-FromMTA: (mailomta27-sa.btinternet.com [213.120.69.33]) at Mon, 16 Mar 2020 19:03:38 +0000
  62.  
  63. On 16/03/2020 17:08, Simon Marchi wrote:
  64. > From: Simon Marchi <[email protected]>
  65. >
  66. > Before this patch, the "Windows" OS ABI is selected for all Windows
  67. > executables, including Cygwin ones. This patch makes GDB differentiate
  68. > Cygwin binaries from non-Cygwin ones, and selects the "Cygwin" OS ABI
  69. > for the Cygwin ones.
  70. >
  71. > To check whether a Windows PE executable is a Cygwin one, we check the
  72. > library list in the .idata section, see if it contains "cygwin1.dll".
  73. >
  74. > I had to add code to parse the .idata section, because BFD doesn't seem
  75. > to expose this information. BFD does parse this information, but only
  76. > to print it in textual form (function pe_print_idata):
  77. >
  78. [...]
  79. > +
  80. > +bool
  81. > +is_linked_with_cygwin_dll (bfd *abfd)
  82. > +{
  83. > + /* The list of DLLs a PE is linked to is in the .idata section. See:
  84. > +
  85. > + https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#the-idata-section
  86. > + */
  87. > + asection *idata_section = bfd_get_section_by_name (abfd, ".idata");
  88. > + if (idata_section == nullptr)
  89. > + return false;
  90.  
  91. I'm fine with this as-is, but FTR I think this only happens to work
  92. because binutils ld (which is probably the only way to currently build a
  93. cygwin executable) puts the import table in the .idata section.
  94.  
  95. The strictly correct way to locate the import table is to use the data
  96. directory (as pe_print_idata() does)
  97.  
  98. (See
  99. https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#optional-header-data-directories-image-only)
  100.  
  101. (Notwithstanding the MS documentation you linked, I believe MS tools can
  102. put the import table in .rdata)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement