From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by sourceware.org (Postfix) with ESMTPS id C29EB3858D20; Sat, 21 Jan 2023 10:47:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C29EB3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-x331.google.com with SMTP id bg13-20020a05600c3c8d00b003d9712b29d2so7441491wmb.2; Sat, 21 Jan 2023 02:47:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=qSkGIU2Ur2ifPkwktdZuw1Ld9z418wLjZv52h4Becc4=; b=Z/tbH0lbvV3NcSJsoNpXAvNgIHX0LHkkko51dfl/dXmC4a7g2120GOucEYMZ9InxSp rXM7RCBI0U3UVpIEmLlfN05P03144QzuPD4RasuTDs/JpNTV7iDiGcgyBdqeKxCo2DJy DMQvNtragAcb3dvu33OQcQs7LPJjb/CEY+HcS7dW7REM7GhTEHolWUJnPD6nmAJ6PxRN UussLfgYkIvtvbh2YTzNqk52tSV5fxsJHGQxkflIb2mclO49eG4vQe9dtrITiUpgpkYp 1AI5rGbtubR6NdKLHieNgcpMY1g44qPjXj3UobP8tlN70MeMTbD5DW3tsiUuXY6LRiaz Uepw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qSkGIU2Ur2ifPkwktdZuw1Ld9z418wLjZv52h4Becc4=; b=v/ebuSSwSh4sWEadoUAkVOBzUwiI+udaaj8h33SZzgfgb/fHZN4p8pknWQM2lipXsw LG64hJ4OswZSruBBPXyWOOGMPWZg7kXo/Dn5Ba5zCI54DWZ+z2r5LHuo09Lmqeeaz08M pxuOIOC9+oIaKWJC953aBfOU4v5E3NjEOa+wA0+fQqv4ba7Ph47nYRZ8EG60v7V95rlZ BkbW2mgJIlaSJgLn6LrdK3K4LgNp3UZKHKVEiD+kzLlkhXjqAI/WP6c3e2SdibqH1DPh l8yHN8u46R/xOw7UewcCnhJSxI37dc5CyWZcSuhRDEsQQhg0sXOKEkUd/vBitjJFIOcL BBng== X-Gm-Message-State: AFqh2kpHqPN6yCIsvM6WgClrYYJOo3OVH2qmfcq2LRf/z62h+ArdLI14 eGDvVIp6jSkTLVQVkyFcfd8= X-Google-Smtp-Source: AMrXdXvSK1ywGKTugeB5QPdqBL0p8GhPbPPsFFsq50Du8SjJ9calK89QZfOZfLuNo6vjWk5AN4KOKg== X-Received: by 2002:a05:600c:d3:b0:3da:23a4:627e with SMTP id u19-20020a05600c00d300b003da23a4627emr16725040wmm.6.1674298063333; Sat, 21 Jan 2023 02:47:43 -0800 (PST) Received: from [10.21.0.4] ([185.246.211.91]) by smtp.gmail.com with ESMTPSA id n16-20020a05600c181000b003d1de805de5sm4540927wmp.16.2023.01.21.02.47.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 21 Jan 2023 02:47:43 -0800 (PST) Message-ID: Date: Sat, 21 Jan 2023 11:47:42 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH 3/4] libbacktrace: work with aslr on windows Content-Language: en-US To: Eli Zaretskii Cc: gcc@hazardy.de, gcc-patches@gcc.gnu.org, gcc@gcc.gnu.org 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> <83h6wkmt0t.fsf@gnu.org> From: Gabriel Ravier In-Reply-To: <83h6wkmt0t.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_ABUSEAT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 1/21/23 05:05, Eli Zaretskii wrote: >> 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). A program that calls GetModuleHandleA will also refuse to start on Windows if it doesn't have that API. The set of Windows versions that do not have GetModuleHandleA is, according to MSDN, the same as the set of Windows versions that do not have GetModuleHandleW.