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:message-id:date:from:mime-version:to:subject :references:in-reply-to:content-type; q=dns; s=default; b=mYxhW6 dDpNFonQWgPDKa/vKEEG7BAx0v6kld4tkpbfaKaPAssbTsx2CQOC3suPPLRNQ9rU UKy6cIWROajP/SoOGNGrLBd3k3PhE0mW8HQn4geOu50Uvd3V/9OLdM0s/Tg7sqeV fNQY1Jayh8szjaiTgq6Gn3YSML9cgTUfFHsmM= 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:message-id:date:from:mime-version:to:subject :references:in-reply-to:content-type; s=default; bh=W6nyliDUPlaE Z9rxtZHkj5vFvuA=; b=dmK2Vrrr5ILYqyWIbpLEU6Bey55wfdYwIOSYSdq10GGf Qu41GaYYNU4/deBKJQ9bK0XoEpgjA2R3D3rgKOmauiOLGJkCzjL9ScNO58rFQacW mLo56GSFHSbIWxfaADrB0Q4bq+R6Z4303PwuzbOTSe8oajbDuO1d3+Z4rXRWF0o= 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 X-Spam-SWARE-Status: No, score=-4.1 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_NO,RCVD_IN_HOSTKARMA_YE,RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.2 Message-ID: <520FA685.801@t-online.de> Date: Sat, 17 Aug 2013 18:36:21 +0200 From: Christian Franke User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20100101 Firefox/22.0 SeaMonkey/2.19 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: binutils feature request: ld --disable-large-address-aware [PATCH] References: <520D2A71 DOT 3000109 AT t-online DOT de> In-Reply-To: <520D2A71.3000109@t-online.de> Content-Type: multipart/mixed; boundary="------------060002050404030709080201" X-Virus-Found: No --------------060002050404030709080201 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Christian Franke wrote: > A few programs are not compatible with --large-address-aware which is > enabled by default in current x86 ld. For example cdrkit, dvd+rw-tools > and smartmontools use IOCTL_SCSI_PASS_THROUGH_DIRECT which apparently > requires user buffers below 2GiB. > > Using "LDFLAGS=-Wl,--disable-large-address-aware" would be much easier > than adding an extra Cygwin specific "peflags --bigaddr=false *.exe" > post-build step. > > (http://cygwin.com/ml/cygwin/2012-04/msg00342.html :-) With the attached patch, "gcc -Wl,--disable-large-address-aware ..." works as expected. Documentation update is missing. It would probably make sense to add a --enable-large-address-aware option as a synonym for --large-address-aware to keep enable/disable options consistent. There is a similar issue with --tsaware. It is enabled by default in spec file but cannot be disabled in gcc command line. I don't know whether there is a need for --disable-tsaware. Christian --------------060002050404030709080201 Content-Type: text/x-patch; name="binutils-disable-large-address-aware.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="binutils-disable-large-address-aware.patch" diff -ru binutils-2.23.52-5/origsrc/src/ld/emultempl/pe.em binutils-2.23.52-5/src/src/ld/emultempl/pe.em --- binutils-2.23.52-5/origsrc/src/ld/emultempl/pe.em 2013-04-29 10:22:16.000000000 +0200 +++ binutils-2.23.52-5/src/src/ld/emultempl/pe.em 2013-08-17 17:56:52.791228500 +0200 @@ -242,8 +242,10 @@ (OPTION_DLL_ENABLE_RUNTIME_PSEUDO_RELOC + 1) #define OPTION_LARGE_ADDRESS_AWARE \ (OPTION_DLL_DISABLE_RUNTIME_PSEUDO_RELOC + 1) -#define OPTION_DLL_ENABLE_RUNTIME_PSEUDO_RELOC_V1 \ +#define OPTION_DISABLE_LARGE_ADDRESS_AWARE \ (OPTION_LARGE_ADDRESS_AWARE + 1) +#define OPTION_DLL_ENABLE_RUNTIME_PSEUDO_RELOC_V1 \ + (OPTION_DISABLE_LARGE_ADDRESS_AWARE + 1) #define OPTION_DLL_ENABLE_RUNTIME_PSEUDO_RELOC_V2 \ (OPTION_DLL_ENABLE_RUNTIME_PSEUDO_RELOC_V1 + 1) #define OPTION_EXCLUDE_MODULES_FOR_IMPLIB \ @@ -333,6 +335,7 @@ {"enable-runtime-pseudo-reloc-v2", no_argument, NULL, OPTION_DLL_ENABLE_RUNTIME_PSEUDO_RELOC_V2}, #endif {"large-address-aware", no_argument, NULL, OPTION_LARGE_ADDRESS_AWARE}, + {"disable-large-address-aware", no_argument, NULL, OPTION_DISABLE_LARGE_ADDRESS_AWARE}, {"enable-long-section-names", no_argument, NULL, OPTION_ENABLE_LONG_SECTION_NAMES}, {"disable-long-section-names", no_argument, NULL, OPTION_DISABLE_LONG_SECTION_NAMES}, {"dynamicbase",no_argument, NULL, OPTION_DYNAMIC_BASE}, @@ -472,6 +475,8 @@ #endif fprintf (file, _(" --large-address-aware Executable supports virtual addresses\n\ greater than 2 gigabytes\n")); + fprintf (file, _(" --disable-large-address-aware Executable does not support virtual\n\ + addresses greater than 2 gigabytes\n")); fprintf (file, _(" --enable-long-section-names Use long COFF section names even in\n\ executable image files\n")); fprintf (file, _(" --disable-long-section-names Never use long COFF section names, even\n\ @@ -828,6 +833,9 @@ case OPTION_LARGE_ADDRESS_AWARE: real_flags |= IMAGE_FILE_LARGE_ADDRESS_AWARE; break; + case OPTION_DISABLE_LARGE_ADDRESS_AWARE: + real_flags &= ~ IMAGE_FILE_LARGE_ADDRESS_AWARE; + break; case OPTION_ENABLE_LONG_SECTION_NAMES: pe_use_coff_long_section_names = 1; break; --------------060002050404030709080201 Content-Type: text/plain; charset=us-ascii -- 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 --------------060002050404030709080201--