public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* binutils feature request: ld --disable-large-address-aware option
@ 2013-08-15 19:22 Christian Franke
  2013-08-17 16:36 ` binutils feature request: ld --disable-large-address-aware [PATCH] Christian Franke
  0 siblings, 1 reply; 5+ messages in thread
From: Christian Franke @ 2013-08-15 19:22 UTC (permalink / raw)
  To: cygwin

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

Thanks,
Christian


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: binutils feature request: ld --disable-large-address-aware [PATCH]
  2013-08-15 19:22 binutils feature request: ld --disable-large-address-aware option Christian Franke
@ 2013-08-17 16:36 ` Christian Franke
  2013-08-19  9:11   ` Corinna Vinschen
  0 siblings, 1 reply; 5+ messages in thread
From: Christian Franke @ 2013-08-17 16:36 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 986 bytes --]

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


[-- Attachment #2: binutils-disable-large-address-aware.patch --]
[-- Type: text/x-patch, Size: 2360 bytes --]

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;


[-- Attachment #3: Type: text/plain, Size: 218 bytes --]

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: binutils feature request: ld --disable-large-address-aware [PATCH]
  2013-08-17 16:36 ` binutils feature request: ld --disable-large-address-aware [PATCH] Christian Franke
@ 2013-08-19  9:11   ` Corinna Vinschen
  2013-08-22 16:08     ` Christian Franke
  0 siblings, 1 reply; 5+ messages in thread
From: Corinna Vinschen @ 2013-08-19  9:11 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1577 bytes --]

Hi Christian,

On Aug 17 18:36, Christian Franke wrote:
> 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.

I think it makes sense to add options to manipulate the Windows-specific
header flags...

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

... even for tsaware though I don't think it's wise to remove this
flag from executables, given the impact.

Nevertheless, the binutils ML is the right place to send patches
and discuss these things.  You should send your patch their.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: binutils feature request: ld --disable-large-address-aware [PATCH]
  2013-08-19  9:11   ` Corinna Vinschen
@ 2013-08-22 16:08     ` Christian Franke
  2013-08-22 17:14       ` Corinna Vinschen
  0 siblings, 1 reply; 5+ messages in thread
From: Christian Franke @ 2013-08-22 16:08 UTC (permalink / raw)
  To: cygwin

Corinna Vinschen wrote:
> ...
> Nevertheless, the binutils ML is the right place to send patches
> and discuss these things.  You should send your patch their.

Done:

http://sourceware.org/ml/binutils/2013-08/msg00184.html

Christian


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: binutils feature request: ld --disable-large-address-aware [PATCH]
  2013-08-22 16:08     ` Christian Franke
@ 2013-08-22 17:14       ` Corinna Vinschen
  0 siblings, 0 replies; 5+ messages in thread
From: Corinna Vinschen @ 2013-08-22 17:14 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 461 bytes --]

On Aug 22 18:08, Christian Franke wrote:
> Corinna Vinschen wrote:
> >...
> >Nevertheless, the binutils ML is the right place to send patches
> >and discuss these things.  You should send your patch their.
> 
> Done:
> 
> http://sourceware.org/ml/binutils/2013-08/msg00184.html

Thanks!


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-08-22 17:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-15 19:22 binutils feature request: ld --disable-large-address-aware option Christian Franke
2013-08-17 16:36 ` binutils feature request: ld --disable-large-address-aware [PATCH] Christian Franke
2013-08-19  9:11   ` Corinna Vinschen
2013-08-22 16:08     ` Christian Franke
2013-08-22 17:14       ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).