From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 122305 invoked by alias); 10 May 2018 20:29:52 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 121619 invoked by uid 89); 10 May 2018 20:29:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=respects, H*r:sk:i14-v6s, H*r:sk:a139-v6, CONTENTS X-HELO: mail-wr0-f172.google.com Received: from mail-wr0-f172.google.com (HELO mail-wr0-f172.google.com) (209.85.128.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 10 May 2018 20:29:45 +0000 Received: by mail-wr0-f172.google.com with SMTP id i14-v6so3226284wre.2 for ; Thu, 10 May 2018 13:29:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=q+8uKIqKSJTnxvZK6GRDymMP/W1mGiHy3GABuN8ymak=; b=lBxBHXsb2WyVSd11m7w5H89SdM8cPW510t3m7E11hCtgytBEjl8sFaofBilziM0BDn rXq+C+7rcp1q7VqRhl9jQ94Mx6xnHS+YGqB62m/MeV4Kl/5fmoUi936fXmC0YJVcS3VR j1e99th+ojpX92vCxIuqjWZzWy5iIOqxjhduagThnB0lN82GjGlpgNnvNRbFB/7G15rK vFgcll4KLMvNFRMRWnfL7x+R63vlGES+bM2npbvU/u72IhPBQKg9ua9CF2nqojjX2g4R jTPQECBWw2zGfl1Zz1+mXjQefq5zEskX+2RzREqgBLNjV2KLCVHdYmlruxyQpDuIOc8g H9kQ== X-Gm-Message-State: ALKqPwdfzKzp10sCHAy7V2ZelzvJF7dD2EiiaKI6hbXFTbA+X13XT8aM Kp3P+MdBWjrzSjHdTM96LngPHypy X-Google-Smtp-Source: AB8JxZqhYMNH1YxAoNC6DhZbqUtdcxPTiDmx1L7OObrEUn8j+mRJ/VGXya0NN9zkK+mjwxdZTrzs1g== X-Received: by 2002:adf:8a8e:: with SMTP id y14-v6mr2501421wry.267.1525984183011; Thu, 10 May 2018 13:29:43 -0700 (PDT) Received: from ?IPv6:2003:ee:63c8:2701:101b:d3fa:1073:c94? (p200300EE63C82701101BD3FA10730C94.dip0.t-ipconnect.de. [2003:ee:63c8:2701:101b:d3fa:1073:c94]) by smtp.gmail.com with ESMTPSA id a139-v6sm1974743wma.43.2018.05.10.13.29.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 May 2018 13:29:42 -0700 (PDT) Subject: Re: Defective "portable executables" distributed/created by Cygwin To: cygwin@cygwin.com References: <1F441795A2584E7684AEFE3C6038B78E@W340> From: Marco Atzeri Message-ID: Date: Thu, 10 May 2018 21:26:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <1F441795A2584E7684AEFE3C6038B78E@W340> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2018-05/txt/msg00131.txt.bz2 On 5/10/2018 8:30 PM, Stefan Kanthak wrote: > Hi @ll, > > the "portable executables" distributed by Cygwin (and of course those > created with Cygwin's GCC toolchain too) have INVALID/ILLEGAL headers: > > 0. Microsoft's DUMPBIN.EXE alias LINK.EXE /DUMP aborts with > "access violation" (see below) on almost all Cygwin binaries! A program should never fail in such way. It seems the program is NOT validating properly its input and it is probably expecting the organization of the data as used by Microsoft Visual Studio 2010. As it fails probably you can not fully trust its output for program built from other compilers. > 1. they use INVALID/ILLEGAL section names like "/4" or "/14", upon > which Microsoft's DUMPBIN.EXE alias LINK.EXE /DUMP stops enumerating > the section headers (see below)! It seems Cygwin tools disagree with such interpretation $ objdump -h /usr/bin/bash.exe /usr/bin/bash.exe: file format pei-x86-64 Sections: Idx Name Size VMA LMA File off Algn 0 .text 0007ce08 0000000100401000 0000000100401000 00000400 2**4 CONTENTS, ALLOC, LOAD, READONLY, CODE, DATA 1 .data 000033c8 000000010047e000 000000010047e000 0007d400 2**5 CONTENTS, ALLOC, LOAD, DATA 2 .rdata 0001caf8 0000000100482000 0000000100482000 00080800 2**5 CONTENTS, ALLOC, LOAD, READONLY, DATA 3 .buildid 00000035 000000010049f000 000000010049f000 0009d400 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA 4 .pdata 0000492c 00000001004a0000 00000001004a0000 0009d600 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA 5 .xdata 0000459c 00000001004a5000 00000001004a5000 000a2000 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA 6 .bss 0000a980 00000001004aa000 00000001004aa000 00000000 2**5 ALLOC 7 .edata 00009722 00000001004b5000 00000001004b5000 000a6600 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA 8 .idata 000035c8 00000001004bf000 00000001004bf000 000afe00 2**2 CONTENTS, ALLOC, LOAD, DATA 9 .rsrc 000004e8 00000001004c3000 00000001004c3000 000b3400 2**2 CONTENTS, ALLOC, LOAD, DATA 10 .reloc 00000c70 00000001004c4000 00000001004c4000 000b3a00 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA 11 .gnu_debuglink 00000014 00000001004c5000 00000001004c5000 000b4800 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA As bash.exe is working fine, I doubt it is using a invalid structure. > From the PE format specification > : Have you also noted: "Note This document is provided to aid in the development of tools and applications for Windows but is not guaranteed to be a complete specification in all respects. Microsoft reserves the right to alter this document without notice." Regards Marco -- 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