Re: [Mingw-w64-public] [PATCH v2] gendef: Recognize PE binaries which do not have all Data Directories

2024-12-11 Thread Pali Rohár
On Wednesday 11 December 2024 17:43:40 Martin Storsjö wrote: > On Wed, 11 Dec 2024, LIU Hao wrote: > > > 在 2024-12-11 21:33, Martin Storsjö 写道: > > > > > > > >   if (gPEDta) > > > >     { > > > > -  va_rel = > > > > gPEDta->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC].Virtua

Re: [Mingw-w64-public] [PATCH v2] gendef: Recognize PE binaries which do not have all Data Directories

2024-12-11 Thread Pali Rohár
On Wednesday 11 December 2024 15:33:44 Martin Storsjö wrote: > I see that do_pedef changes cases for both IMAGE_DIRECTORY_ENTRY_IMPORT and > IMAGE_DIRECTORY_ENTRY_EXPORT, but do_pepdef only changes cases for > IMAGE_DIRECTORY_ENTRY_EXPORT. Is there no matching case for > IMAGE_DIRECTORY_ENTRY_IMPOR

Re: [Mingw-w64-public] [PATCH v2] gendef: Recognize PE binaries which do not have all Data Directories

2024-12-11 Thread Martin Storsjö
On Wed, 11 Dec 2024, Pali Rohár wrote: On Wednesday 11 December 2024 17:43:40 Martin Storsjö wrote: On Wed, 11 Dec 2024, LIU Hao wrote: 在 2024-12-11 21:33, Martin Storsjö 写道:   if (gPEDta)     { -  va_rel = gPEDta->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAd

Re: [Mingw-w64-public] Merging lib32/*.def and lib-common/*.def files?

2024-12-11 Thread Jacek Caban
On 11.12.2024 20:20, Pali Rohár wrote: If you are open for this idea, that it is not totally stupid thing (I was not sure that is why I opened this discussion before trying to implement anything) I can try to prepare some PoC patch. FWIW, I agree that there's room for improvement, and I think

Re: [Mingw-w64-public] Merging lib32/*.def and lib-common/*.def files?

2024-12-11 Thread Biswapriyo Nath
I don't have any strong opinion about this topic and would just adapt to new DEF file style after any change. Though, the inner me says "if it ain't broke, don't fix it". ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://l

Re: [Mingw-w64-public] Merging lib32/*.def and lib-common/*.def files?

2024-12-11 Thread Pali Rohár
On Wednesday 11 December 2024 15:17:55 Martin Storsjö wrote: > On Mon, 9 Dec 2024, Pali Rohár wrote: > > > I see that in mingw-w64-crt/lib32/ are lot of def files which are > > basically same as def files in mingw-w64-crt/lib-common/, just lib32 > > variants have @STDCALL suffixes. They have same

Re: [Mingw-w64-public] Merging lib32/*.def and lib-common/*.def files?

2024-12-11 Thread Martin Storsjö
On Mon, 9 Dec 2024, Pali Rohár wrote: I see that in mingw-w64-crt/lib32/ are lot of def files which are basically same as def files in mingw-w64-crt/lib-common/, just lib32 variants have @STDCALL suffixes. They have same set of functions (just sometimes there are arch-specific available only for

Re: [Mingw-w64-public] [PATCH 2/2] winpthreads: Run thread dtors in reverse order

2024-12-11 Thread Martin Storsjö
On Fri, 6 Dec 2024, LIU Hao wrote: 在 2024-12-06 07:20, Martin Storsjö 写道: Thanks - so I guess this patch could be pushed on its own, even if we don't yet figure out a good way forward with the other one. This patch is OK for me. (because it's simple; not because it's perfect.) Ok, I pushed

Re: [Mingw-w64-public] [PATCH v2] gendef: Recognize PE binaries which do not have all Data Directories

2024-12-11 Thread Martin Storsjö
On Wed, 4 Dec 2024, Pali Rohár wrote: PE format allows to have variable length of Data Directories in PE Optional Header. The exact number of Data Directories is stored in NumberOfRvaAndSizes field. Size of the optional header depends on the number of Data Directories. Constants IMAGE_SIZEOF_NT

Re: [Mingw-w64-public] [PATCH v2] gendef: Recognize PE binaries which do not have all Data Directories

2024-12-11 Thread LIU Hao
在 2024-12-11 21:33, Martin Storsjö 写道:   if (gPEDta)     { -  va_rel = gPEDta->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress; -  sz_rel = gPEDta->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC].Size; +  if (gPEDta->OptionalHeader.NumberO

Re: [Mingw-w64-public] [PATCH v2] gendef: Recognize PE binaries which do not have all Data Directories

2024-12-11 Thread Martin Storsjö
On Wed, 11 Dec 2024, LIU Hao wrote: 在 2024-12-11 21:33, Martin Storsjö 写道:   if (gPEDta)     { -  va_rel = gPEDta->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress; -  sz_rel = gPEDta->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC].Size; +