mingw: GCC now identifies function ends by checking for .seh_endproc directives.
GCC can now identify the end of functions in MinGW binaries by checking for the .seh_endproc directive.
GCC now recognizes the .seh_endproc directive as a marker for the end of a function when targeting MinGW. This commit extends a previous change that added this recognition for AArch64 MinGW targets to cover all MinGW targets, improving disassembly and analysis of MinGW binaries.
In Details
The lib/scanasm.exp script is used to scan assembly files and identify function boundaries. This commit modifies the configure_check-function-bodies procedure to check for the .seh_endproc directive when processing MinGW binaries. This directive is used by the Windows exception handling mechanism to mark the end of a function, and this change allows GCC to correctly identify function boundaries even in the presence of complex exception handling code.
For Context
When compiling code for Windows using the MinGW environment, the compiler needs to be able to identify the start and end of functions. This information is used for various purposes, such as generating debugging information and handling exceptions. This commit extends GCC's ability to identify function ends in MinGW binaries by checking for a specific directive (.seh_endproc) that marks the end of a function. This improves the accuracy of tools that analyze MinGW binaries.