Re: [Mingw-w64-public] [PATCH] crt/delayimp: Make an IAT entry writeable before modifying it

2025-03-07 Thread Jeremy Drake via Mingw-w64-public
On Sat, 8 Mar 2025, LIU Hao wrote: > 在 2025-3-8 10:23, Jeremy Drake via Mingw-w64-public 写道: > > > This patch unfortunately does a few different things at this point: > > > * moves delay load directory table into .didat$2 section, and puts this > > > into .idata(!) > > > * fills in the delay impor

Re: [Mingw-w64-public] [PATCH] crt/delayimp: Make an IAT entry writeable before modifying it

2025-03-07 Thread Jeremy Drake via Mingw-w64-public
On Sat, 8 Mar 2025, LIU Hao wrote: > In our delayimp.c there's: > >``` >static unsigned IndexFromPImgThunkData(PCImgThunkData > pitdCur,PCImgThunkData pitdBase) >{ > return (unsigned) (pitdCur - pitdBase); >} > >// ... ... > >FARPROC WINAPI __delayLoadHelper2(PCImgDela

Re: [Mingw-w64-public] [PATCH] crt/delayimp: Make an IAT entry writeable before modifying it

2025-03-07 Thread LIU Hao
在 2025-3-8 10:57, LIU Hao 写道: As said above, ideally all the pieces in `.idata` and `.didat`, other than `.didat$5`, should be put into `.rdata` and not entire new sections on their own. I previously attempted to move `R_IDATA` etc. into `.rdata` but the program crashed upon startup. In our de

Re: [Mingw-w64-public] [PATCH] crt/delayimp: Make an IAT entry writeable before modifying it

2025-03-07 Thread LIU Hao
在 2025-3-8 10:23, Jeremy Drake via Mingw-w64-public 写道: This patch unfortunately does a few different things at this point: * moves delay load directory table into .didat$2 section, and puts this into .idata(!) * fills in the delay import descriptor table data directory entry I didn't add it be

Re: [Mingw-w64-public] [PATCH] crt/delayimp: Make an IAT entry writeable before modifying it

2025-03-07 Thread Jeremy Drake via Mingw-w64-public
On Fri, 7 Mar 2025, Jeremy Drake via Mingw-w64-public wrote: > On Fri, 7 Mar 2025, Jeremy Drake via Mingw-w64-public wrote: > > > On Fri, 7 Mar 2025, Jeremy Drake via Mingw-w64-public wrote: > > > > > That bug was avoided, due to the fact that the code that tries to > > > garbage-collect unused st

Re: [Mingw-w64-public] [PATCH] crt/delayimp: Make an IAT entry writeable before modifying it

2025-03-07 Thread Jeremy Drake via Mingw-w64-public
On Fri, 7 Mar 2025, Jeremy Drake via Mingw-w64-public wrote: > On Fri, 7 Mar 2025, Jeremy Drake via Mingw-w64-public wrote: > > > That bug was avoided, due to the fact that the code that tries to > > garbage-collect unused stubs only looks at .idata sections, and delayloads > > are now in .didat s

Re: [Mingw-w64-public] [PATCH] crt/delayimp: Make an IAT entry writeable before modifying it

2025-03-07 Thread Jeremy Drake via Mingw-w64-public
On Fri, 7 Mar 2025, Jeremy Drake via Mingw-w64-public wrote: > That bug was avoided, due to the fact that the code that tries to > garbage-collect unused stubs only looks at .idata sections, and delayloads > are now in .didat sections. > > However, this patch is probably overkill. This puts the w

Re: [Mingw-w64-public] [PATCH] crt/delayimp: Make an IAT entry writeable before modifying it

2025-03-07 Thread Jeremy Drake via Mingw-w64-public
On Fri, 7 Mar 2025, Jeremy Drake via Mingw-w64-public wrote: > On Sat, 8 Mar 2025, LIU Hao wrote: > > > Please try this patch for binutils. > > Will do. Could you also take a look at > https://sourceware.org/bugzilla/show_bug.cgi?id=14339 ? It should be > 'adjacent', and probably just a matter t

Re: [Mingw-w64-public] stat, _stat, and _stat64i32 issues (was: dirent changes)

2025-03-07 Thread Lasse Collin
On 2025-03-07 Pali Rohár wrote: > On Thursday 06 March 2025 21:40:55 Lasse Collin wrote: > > On 2025-03-05 Pali Rohár wrote: > > > Do you want to look at my changes or test them? > > > > Yes, I'm interested. It might take a few days depending on how I > > have time. > > Ok. I'm sending 10 p

Re: [Mingw-w64-public] [PATCH] crt/delayimp: Make an IAT entry writeable before modifying it

2025-03-07 Thread Jeremy Drake via Mingw-w64-public
On Sat, 8 Mar 2025, LIU Hao wrote: > Please try this patch for binutils. Will do. Could you also take a look at https://sourceware.org/bugzilla/show_bug.cgi?id=14339 ? It should be 'adjacent', and probably just a matter to make sure the right section(s) are counted as 'referenced' so they're em

Re: [Mingw-w64-public] [PATCH] crt/delayimp: Make an IAT entry writeable before modifying it

2025-03-07 Thread LIU Hao
在 2025-3-7 06:51, Jeremy Drake via Mingw-w64-public 写道: On Thu, 6 Mar 2025, Jeremy Drake via Mingw-w64-public wrote: On Thu, 6 Mar 2025, Jacek Caban wrote: Relying on __delayLoadHelper2 behavior specific to mingw-w64 comes with drawbacks. As I mentioned earlier, an application can forward the