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:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=eUREvtvSSOTbeHiR BQ6RPkYX9OBPtMqHCuFStzpHmVbA87iihcpKNb2IcPpGS81Frb5oSl2Z1H9FKpv4 9FC8810WAhlTGQSDkngJVNs4SQnmqO1aEcCMmB642R1QrmOdAg6dog+VA2t+ndTG O61Rmm9nilKtH3Kdw0tfavDgKHc= 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:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=KeSYCWe6fD7/brOKkgL7DP yPFIw=; b=njfk/Rz3tJWzSkjWazct2Va3WUTVDbag25CJqE1ADU0IkBA6Gf+Yzk z0+BUMzGRqX2DtceBL2cznT48X91QWOhla6x+/A3zDA+lKfG/zpDPX8xXHxzVcVI YoZSFNfG6bxNRMOeJoGlv/KDAd5tZtXEIi/PTBUkZk8rgScFjtSyw= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , 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=-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 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) Subject: Re: Defective "portable executables" distributed/created by Cygwin To: cygwin AT cygwin DOT com References: <1F441795A2584E7684AEFE3C6038B78E AT W340> From: Marco Atzeri Message-ID: Date: Thu, 10 May 2018 22:29:40 +0200 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 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