TeeEmCee wrote: ↑May 10, 2022 8:08
Did you check that it's actually missing from compiled .exes?
Yep
https://prnt.sc/HD6jSu_yx-pv
Also, GCC apparently does not support SEH on x86, only on x86_64, where SEH works "quite differently". From that MSVC page:
GCC doesn't support x86 SEH in the same sense that FB doesn't support MP3 output. There's no way to do it out of the box,
but if you write the appropriate code yourself, you can certainly make it happen.
Anyway, I checked the source code of LD/BFD and there's no references to _load_config_used or any direct reference to IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG (or PE_LOAD_CONFIG_TABLE) so I guess there's no automatic doing of that. LD does have a plugin interface but it's very much built for and around what GCC Link Time Optimization requires, so it's pretty useless for any purpose that requires final symbol addresses/offsets in the image.
The only way then seems to be to have LD generate a map file, parse that, and then edit the exe/dll header afterwards.
dodicat wrote: ↑May 10, 2022 9:07
Would it be easier than injecting stuff into an executable via MinGW?
The problem I'm fixing are the ones that happen when the thing that causes the Error, and the On Error Goto statement are in different subs/functions. If you Print local variables after the Goto has happened, they'll either crash your app or have different values to what they did/should do.
I don't have to use SEH to do it, but it enables FB to participate in and interoperate with other languages that support it.