From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail231.csoft.net (mail231.csoft.net [96.47.74.235]) by sourceware.org (Postfix) with ESMTPS id 778443850406 for ; Mon, 1 Mar 2021 19:43:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 778443850406 Received: from mail231.csoft.net (localhost [127.0.0.1]) by mail231.csoft.net (Postfix) with ESMTP id CDC72CC34 for ; Mon, 1 Mar 2021 14:43:45 -0500 (EST) Received: from mail231 (mail231 [96.47.74.235]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) (Authenticated sender: jeremyd) by mail231.csoft.net (Postfix) with ESMTPSA id CAD7FCC1B for ; Mon, 1 Mar 2021 14:43:45 -0500 (EST) Date: Mon, 1 Mar 2021 11:43:45 -0800 (PST) From: Jeremy Drake X-X-Sender: jeremyd@resin.csoft.net To: binutils@sourceware.org Subject: [PATCH] ld: revert default dll characteristics for Cygwin. Message-ID: User-Agent: Alpine 2.21 (BSO 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_PASS, 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: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 19:43:47 -0000 Mail thread from https://cygwin.com/pipermail/cygwin/2021-February/247922.html suggests these flags will NOT work for Cygwin, which relies on stable address layouts for their fork() emulation. In the process, renamed move_default_addr_high shell variable to cygwin_beahior, as the old name wasn't quite accurate anymore and I wanted to use it choose which dll characteristics flags to use by default. Also copied that switch to pe.em, as it was only in pep.em before but 32-bit also needed to switch defaults for Cygwin. --- ld/emultempl/pe.em | 13 ++++++++++++- ld/emultempl/pep.em | 40 +++++++++++++++++++++------------------- 2 files changed, 33 insertions(+), 20 deletions(-) diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em index 748a6b49412..9f757cc31dc 100644 --- a/ld/emultempl/pe.em +++ b/ld/emultempl/pe.em @@ -5,6 +5,16 @@ if [ -z "$MACHINE" ]; then else OUTPUT_ARCH=${ARCH}:${MACHINE} fi + +case ${target} in + *-*-cygwin*) + cygwin_behavior=1 + ;; + *) + cygwin_behavior=0; + ;; +esac + rm -f e${EMULATION_NAME}.c (echo;echo;echo;echo;echo)>e${EMULATION_NAME}.c # there, now line numbers match ;-) fragment <