Re: [PATCH 3/4] libbacktrace: work with aslr on windows

2023-11-30 Thread Ian Lance Taylor
On Mon, Nov 20, 2023 at 11:58 AM Björn Schäpers wrote: > > An updated version, using neither A or W, but just the macro. Thanks. Committed as follows. Ian 1017495bc91d40570f58c37e88ca013164782129 diff --git a/libbacktrace/pecoff.c b/libbacktrace/pecoff.c index 56af4828e27..f976a963bf3 100644

Re: [PATCH 3/4] libbacktrace: work with aslr on windows

2023-11-21 Thread LIU Hao
在 2023/11/22 03:35, Björn Schäpers 写道: I'll guess it is not needed here, but otherwise defines the macros max and min, they then conflict e.g. with C++'s std::max/std::min. So I consider it best practice to always define it, before including . The mingw-w64 header does not define them for

Re: [PATCH 3/4] libbacktrace: work with aslr on windows

2023-11-21 Thread Björn Schäpers
I'll guess it is not needed here, but otherwise defines the macros max and min, they then conflict e.g. with C++'s std::max/std::min. So I consider it best practice to always define it, before including . Am 20.11.2023 um 21:07 schrieb Eli Zaretskii: Date: Mon, 20 Nov 2023 20:57:38 +0100 Cc:

Re: [PATCH 3/4] libbacktrace: work with aslr on windows

2023-11-20 Thread Eli Zaretskii
> Date: Mon, 20 Nov 2023 20:57:38 +0100 > Cc: gcc-patches@gcc.gnu.org, g...@gcc.gnu.org > From: Björn Schäpers > > +#ifndef NOMINMAX > +#define NOMINMAX > +#endif Why is this part needed? Otherwise, LGTM, thanks. (But I'm don't have the approval rights, so please wait for Ian to chime in.)

Re: [PATCH 3/4] libbacktrace: work with aslr on windows

2023-11-20 Thread Björn Schäpers
An updated version, using neither A or W, but just the macro. Am 21.01.2023 um 12:42 schrieb Eli Zaretskii: Date: Sat, 21 Jan 2023 11:47:42 +0100 Cc: g...@hazardy.de, gcc-patches@gcc.gnu.org, g...@gcc.gnu.org From: Gabriel Ravier On 1/21/23 05:05, Eli Zaretskii wrote: Date: Fri, 20 Jan 2023

Re: [PATCH 3/4] libbacktrace: work with aslr on windows

2023-01-21 Thread Eli Zaretskii via Gcc-patches
> Date: Sat, 21 Jan 2023 11:47:42 +0100 > Cc: g...@hazardy.de, gcc-patches@gcc.gnu.org, g...@gcc.gnu.org > From: Gabriel Ravier > > > On 1/21/23 05:05, Eli Zaretskii wrote: > >> Date: Fri, 20 Jan 2023 21:39:56 +0100 > >> Cc: g...@hazardy.de, gcc-patches@gcc.gnu.org, g...@gcc.gnu.org > >> From:

Re: [PATCH 3/4] libbacktrace: work with aslr on windows

2023-01-21 Thread Gabriel Ravier via Gcc-patches
On 1/21/23 05:05, Eli Zaretskii wrote: Date: Fri, 20 Jan 2023 21:39:56 +0100 Cc: g...@hazardy.de, gcc-patches@gcc.gnu.org, g...@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

Re: [PATCH 3/4] libbacktrace: work with aslr on windows

2023-01-21 Thread Eli Zaretskii via Gcc-patches
> Date: Sat, 21 Jan 2023 17:18:14 +0800 > Cc: g...@hazardy.de, gcc-patches@gcc.gnu.org, g...@gcc.gnu.org > From: LIU Hao > > 在 2023-01-21 12:05, Eli Zaretskii via Gcc 写道: > > I'm not sure I follow the logic. A program that calls > > GetModuleHandleW will refuse to start on Windows that doesn't

Re: [PATCH 3/4] libbacktrace: work with aslr on windows

2023-01-21 Thread LIU Hao via Gcc-patches
在 2023-01-21 12:05, Eli Zaretskii via Gcc 写道: 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

Re: [PATCH 3/4] libbacktrace: work with aslr on windows

2023-01-20 Thread Eli Zaretskii via Gcc-patches
> Date: Fri, 20 Jan 2023 21:39:56 +0100 > Cc: g...@hazardy.de, gcc-patches@gcc.gnu.org, g...@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

Re: [PATCH 3/4] libbacktrace: work with aslr on windows

2023-01-20 Thread Gabriel Ravier via Gcc-patches
On 1/20/23 20:19, Eli Zaretskii wrote: Date: Fri, 20 Jan 2023 17:46:59 +0100 Cc: gcc-patches@gcc.gnu.org, g...@gcc.gnu.org From: Gabriel Ravier On 1/20/23 14:39, Eli Zaretskii via Gcc wrote: From: Björn Schäpers Date: Fri, 20 Jan 2023 11:54:08 +0100 @@ -856,7 +870,12 @@ coff_add (struct

Re: [PATCH 3/4] libbacktrace: work with aslr on windows

2023-01-20 Thread Eli Zaretskii via Gcc-patches
> Date: Fri, 20 Jan 2023 17:46:59 +0100 > Cc: gcc-patches@gcc.gnu.org, g...@gcc.gnu.org > From: Gabriel Ravier > > On 1/20/23 14:39, Eli Zaretskii via Gcc wrote: > >> From: Björn Schäpers > >> Date: Fri, 20 Jan 2023 11:54:08 +0100 > >> > >> @@ -856,7 +870,12 @@ coff_add (struct backtrace_state

Re: [PATCH 3/4] libbacktrace: work with aslr on windows

2023-01-20 Thread Gabriel Ravier via Gcc-patches
On 1/20/23 14:39, Eli Zaretskii via Gcc wrote: From: Björn Schäpers Date: Fri, 20 Jan 2023 11:54:08 +0100 @@ -856,7 +870,12 @@ coff_add (struct backtrace_state *state, int descriptor, + (sections[i].offset - min_offset)); } - if (!backtrace_dwarf_add

Re: [PATCH 3/4] libbacktrace: work with aslr on windows

2023-01-20 Thread Eli Zaretskii via Gcc-patches
> From: Björn Schäpers > Date: Fri, 20 Jan 2023 11:54:08 +0100 > > @@ -856,7 +870,12 @@ coff_add (struct backtrace_state *state, int descriptor, > + (sections[i].offset - min_offset)); > } > > - if (!backtrace_dwarf_add (state, /* base_address */ 0,

[PATCH 3/4] libbacktrace: work with aslr on windows

2023-01-20 Thread Björn Schäpers
From: Björn Schäpers Any underflow which might happen, will be countered by an overflow in dwarf.c. Tested on x86_64-linux and i686-w64-mingw32. -- >8 -- Fixes https://github.com/ianlancetaylor/libbacktrace/issues/89 and https://github.com/ianlancetaylor/libbacktrace/issues/82. *

[PATCH 3/4] libbacktrace: work with aslr on windows

2022-12-06 Thread Björn Schäpers
From: Björn Schäpers Any underflow which might happen, will be countered by an overflow in dwarf.c. Tested on x86_64-linux and i686-w64-mingw32. -- >8 -- Fixes https://github.com/ianlancetaylor/libbacktrace/issues/89 and https://github.com/ianlancetaylor/libbacktrace/issues/82. *