delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2018/05/10/17:28:08

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=GLtzGvpLGnpWdVqP
xgpImQ+mKG7esaoYaXTqioOSIC8MQbmvOevlio/V718Secs5k1aVHY32Iu7Qm25I
0ZAHQNQDpSWITrS7CtCYQdmAZfk8Xe7scOLL5wXevreh17Udk1GNCo58yIO0dkgg
7+tgev2s5ZdcLdg+TFYH//RSpmk=
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=ZD19+c+mxx/hEww6D44ZLB
a+HBs=; b=CTZT2BL9BCNnhfb54ewzFiBEWVxqdGKH6xWK5Hu8gsFCLl+ShtoVAs
4HCwE6kcmCFIpOAbyrD5EVEE6xNxMpqFkKlQnhYVH+8HHABpF6g4VOoeBl77WFmh
/4h8P3zNzsLa3N8fUIiaA6VgVQLRTiKlZEdR2pQOzGXEM7ZFoETRI=
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.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=H*r:sk:mail.me, viewers, dwarf2, images
X-HELO: out1-smtp.messagingengine.com
X-ME-Sender: <xms:Wbn0WlWdY7sa2gaLA5mDivdDeluhnwcu7zsCEqsM9_U37LJT0ZVhcw>
Subject: Re: Defective "portable executables" distributed/created by Cygwin
To: The Cygwin Mailing List <cygwin AT cygwin DOT com>
References: <1F441795A2584E7684AEFE3C6038B78E AT W340> <ffc2e119-8af9-2d92-4639-cc1e325f719e AT gmail DOT com>
From: Jon Turney <jon DOT turney AT dronecode DOT org DOT uk>
Message-ID: <149505a0-1221-15e4-95e1-9e7e5e1fc236@dronecode.org.uk>
Date: Thu, 10 May 2018 22:27:49 +0100
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0
MIME-Version: 1.0
In-Reply-To: <ffc2e119-8af9-2d92-4639-cc1e325f719e@gmail.com>

On 10/05/2018 21:29, Marco Atzeri wrote:
> 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

This deviation is deliberate, and is discussed in the ld manpage for the 
option which controls it:

        --enable-long-section-names
        --disable-long-section-names
The PE variants of the COFF object format add an extension that
permits the use of section names longer than eight characters, the
normal limit for COFF.  By default, these names are only allowed in
object files, as fully-linked executable images do not carry the
COFF string table required to support the longer names.  As a GNU
extension, it is possible to allow their use in executable images
as well, or to (probably pointlessly!)  disallow it in object
files, by using these two options.  Executable images generated
with these long section names are slightly non-standard, carrying
as they do a string table, and may generate confusing output when
examined with non-GNU PE-aware tools, such as file viewers and
dumpers.  However, GDB relies on the use of PE long section names
to find Dwarf-2 debug information sections in an executable image
at runtime, and so if neither option is specified on the command-
line, ld will enable long section names, overriding the default and
technically correct behaviour, when it finds the presence of debug
information while linking an executable image and not stripping
symbols.  [This option is valid for all PE targeted ports of the
linker]

--
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