[PATCH v4 1/2] bfd: fill in PE load config directory entry.
Jeremy Drake
sourceware-bugzilla@jdrake.com
Wed Apr 2 17:01:15 GMT 2025
On Wed, 2 Apr 2025, LIU Hao wrote:
> The `Subsystem`, `MajorSubsystemVersion` and `MinorSubsystemVersion` fields
> are filled in `_bfd_XXi_swap_aouthdr_in()`, and it's possible to retrieve them
> from the output BFD. As mentioned earlier, if `f_magic` contains
> `IMAGE_FILE_MACHINE_I386` and `Subsystem == IMAGE_SUBSYSTEM_WINDOWS_GUI ||
> Subsystem == IMAGE_SUBSYSTEM_WINDOWS_CUI` and `MajorSubsystemVersion * 256 +
> MinorSubsystemVersionthen <= 0x0501` then it has to be a special case.
I went looking for IMAGE_FILE_MACHINE_I386 in the pe_data and didn't find
it (it'd be cleaner than looking at bfd arch and machine and having to
mask off the bit for intel syntax). I'll have to look again in the
debugger and see if I can find these values available at the time the
data directory is being filled in.
More information about the Binutils
mailing list