From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from fencepost.gnu.org (fencepost.gnu.org [IPv6:2001:470:142:3::e]) by sourceware.org (Postfix) with ESMTPS id 08EA43858D33; Sat, 21 Jan 2023 04:05:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 08EA43858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=ODXPL+QZmcU4J/5/ADKebc8mVzllD3c9mdk7dddZCvs=; b=ggRBzSZZqGHj Xobyg9fFqBUPMJDGy2OgMiQBZb9NkoIbjkpq49jkpu+xX2ODCPaAuUaov6w4N+2MBQ5mCmnyxZDt3 aLgyLsjHMyUOONC9rUH4QNtKuBvS4ErTf/N9M3vem/UMAMNuUtUVi3XX/TPJpXBFU4CZKp9TH0M+5 bCj2GPFDD5AMf5KrrOHvOxHETn24+x8a7wbGXIXQrHguDMzzPOpjPLLwvGtqQT0Q6AqNpFLGEpXy1 R4VmlPQFgbw0R2Ssh/r/ZMEesnGskNiW0j8IJpokybH6HgCRIdGMWz9wkDoC3yuxRA2KAfpqaz9AR qhrUjlWchlWq35Q3xj1waw==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pJ58L-0003MK-3X; Fri, 20 Jan 2023 23:05:37 -0500 Date: Sat, 21 Jan 2023 06:05:38 +0200 Message-Id: <83h6wkmt0t.fsf@gnu.org> From: Eli Zaretskii To: Gabriel Ravier Cc: gcc@hazardy.de, gcc-patches@gcc.gnu.org, gcc@gcc.gnu.org In-Reply-To: <64148e01-15a1-0331-ad52-bf131403ed76@gmail.com> (message from Gabriel Ravier on Fri, 20 Jan 2023 21:39:56 +0100) Subject: Re: [PATCH 3/4] libbacktrace: work with aslr on windows References: <20230120105409.54949-1-gcc@hazardy.de> <20230120105409.54949-3-gcc@hazardy.de> <83zgadmik1.fsf@gnu.org> <83k01hm2sm.fsf@gnu.org> <64148e01-15a1-0331-ad52-bf131403ed76@gmail.com> X-Spam-Status: No, score=2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_BARRACUDACENTRAL,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > Date: Fri, 20 Jan 2023 21:39:56 +0100 > Cc: gcc@hazardy.de, gcc-patches@gcc.gnu.org, gcc@gcc.gnu.org > From: Gabriel Ravier > > >> - using wide APIs with Windows is generally considered to be a best > >> practice, even when not strictly needed (and in this case I can't see > >> any problem with doing so, unless maybe we want to code to work with > >> Windows 95 or something like that...) > > There's no reason to forcibly break GDB on platforms where wide APIs > > are not available. > Are there even any platforms that have GetModuleHandleA but not > GetModuleHandleW ? MSDN states that Windows XP and Windows Server 2003 > are the first versions to support both of the APIs, so if this is > supposed to work on Windows 98, for instance, whether we're using > GetModuleHandleA or GetModuleHandleW won't matter. I'm not sure I follow the logic. A program that calls GetModuleHandleW will refuse to start on Windows that doesn't have that API. So any version before XP is automatically excluded the moment you use code which calls that API directly (i.e. not through a function pointer or somesuch).