X-Recipient: archive-cygwin@delorie.com
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 11AAB384B820
Authentication-Results: sourceware.org;
 dmarc=none (p=none dis=none) header.from=nexgo.de
Authentication-Results: sourceware.org;
 spf=pass smtp.mailfrom=Stromeko@nexgo.de
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nexgo.de;
 s=vfde-smtpout-mb-15sep; t=1614513164;
 bh=CA0yh3IIRRcUPt7I4yatq7680maEXMViO6ztTgxxz0o=;
 h=From:To:Subject:In-Reply-To:References:Date;
 b=Q05YOZvpqY6d4MVe/8eFIxDYMVc32WSMNTjLgkKQobqm6AqABACYo1ey97/KSK6zl
 TaW6awobZeq3K5snp7VBHwFFZc5maK8pFbxagxwO8PdM/NPCFTlA9DMQhBLmlsL7Ev
 XpWSWdaQzqW5ZKx2gKxgrTZ0Rxn6CaW+JEb9nJDE=
From: ASSI <Stromeko@nexgo.de>
To: cygwin@cygwin.com
Subject: Re: cygwin + binutils 2.36 + ASLR/dynamicbase defaults
In-Reply-To: <CAE6_+UewLqP2Tf5FphSqzG21_P-AnXdBjZ+-5-LwJy5n4fXMqg@mail.gmail.com>
 (Christoph Reiter via Cygwin's message of "Sun, 28 Feb 2021 10:46:28
 +0100")
References: <CAE6_+UewLqP2Tf5FphSqzG21_P-AnXdBjZ+-5-LwJy5n4fXMqg@mail.gmail.com>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Date: Sun, 28 Feb 2021 12:52:33 +0100
Message-ID: <87zgzo9zpa.fsf@Otto.invalid>
MIME-Version: 1.0
X-purgate-type: clean
X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de
X-purgate: This mail is considered clean (visit http://www.eleven.de for
 further information)
X-purgate: clean
X-purgate-size: 1630
X-purgate-ID: 155817::1614513164-000006DC-BBCBF805/0/0
X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00, DKIM_SIGNED,
 DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,
 SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
 server2.sourceware.org
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cygwin-bounces@cygwin.com
Sender: "Cygwin" <cygwin-bounces@cygwin.com>

Christoph Reiter via Cygwin writes:
> binutils 2.36 now defaults to ASLR etc on Windows, so a cygwin compiled linker
> will give you:
>
>> peflags -v mydll.dll
> mydll.dll: coff(0x2026[+executable_image,+line_nums_stripped,+bigaddr,+dll])
> pe(0x0160[+high-entropy-va,+dynamicbase,+nxcompat])
>
> Is this still problematic for cygwin?

Yes it is and I'm currently figuring out how to best get rid of it in
order to be able to update binutils (why this was ever allowed in
without an accompanying configure option is a mystery to me).  I've
already nixed it for Cygwin, but I'm not yet sure what to do for the
cross compilation toolchain.  While it should in principle work there,
I'm pretty sure that there will be problems when it comes to the nitty
gritty details.  It's already transpired that some of the linker scripts
can't deal with the larger base addresses this change does generate
eventually.

> The reason I'm asking is because we updated to 2.36 in MSYS2 and are
> wondering if we need to patch this out (or change the defaults) It
> seems to work as is right now, but maybe we are just lucky(?).

You are just lucky and need to test more. :-)

Note that the change does not only affect DLL as the commit message
would want you to believe and you will eventually end up with a
situation where ASLR tries moves the stack of an executable, at which
point you can no longer fork.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Waldorf MIDI Implementation & additional documentation:
http://Synth.Stromeko.net/Downloads.html#WaldorfDocs
--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple
