[PATCH] ld/PE: restrict non-zero default DLL characteristics to MinGW
Jan Beulich
jbeulich@suse.com
Tue Apr 8 08:30:49 GMT 2025
On 04.04.2025 12:07, Jan Beulich wrote:
> While commit ef6379e16dd1 ("Set the default DLL chracteristics to 0 for
> Cygwin based targets") tried to undo the too broad earlier 514b4e191d5f
> ("Change the default characteristics of DLLs built by the linker to more
> secure settings"), it didn't go quite far enough. Apparently the
> assumption was that if it's not MinGW, it must be Cygwin. Whether it
> really is okay to default three of the flags to non-zero on MinGW also
> remains unclear - sadly neither of the commits came with any description
> whatsoever.
It was brought to my attention that documentation also wasn't updated
when restoring the defaults for Cygwin. Hence I've now added the hunks below.
Jan
--- a/ld/ld.texi
+++ b/ld/ld.texi
@@ -3712,7 +3712,8 @@ of the PE file header:
@item --high-entropy-va
@itemx --disable-high-entropy-va
Image is compatible with 64-bit address space layout randomization
-(ASLR). This option is enabled by default for 64-bit PE images.
+(ASLR). This option is enabled by default for 64-bit PE images in
+MinGW targets.
This option also implies @option{--dynamicbase} and
@option{--enable-reloc-section}.
@@ -3722,9 +3723,9 @@ This option also implies @option{--dynam
@itemx --disable-dynamicbase
The image base address may be relocated using address space layout
randomization (ASLR). This feature was introduced with MS Windows
-Vista for i386 PE targets. This option is enabled by default but
-can be disabled via the @option{--disable-dynamicbase} option.
-This option also implies @option{--enable-reloc-section}.
+Vista for i386 PE targets. This option is enabled by default for MinGW
+targets but can be disabled via the @option{--disable-dynamicbase}
+option. This option also implies @option{--enable-reloc-section}.
@kindex --forceinteg
@item --forceinteg
@@ -3737,7 +3738,7 @@ default.
@item --disable-nxcompat
The image is compatible with the Data Execution Prevention.
This feature was introduced with MS Windows XP SP2 for i386 PE
-targets. The option is enabled by default.
+targets. The option is enabled by default for MinGW targets.
@kindex --no-isolation
@item --no-isolation
More information about the Binutils
mailing list