-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect Compiler Identification #98
Comments
Thanks for reporting this, it may explain some strange reports from before! hasRichHeader checks, as the name implies, for presence of rich header which MTuner assumes was generated by MSVC. This is not 100% reliable as it is possible to remove rich header from PE, more info here: https://bytepointer.com/articles/the_microsoft_rich_header.htm So even without seeing your exe, I guess some part of your build process removes rich header from it. I'd be happy to replace this with something more reliable - suggestions welcome! :) |
Would be curious to know what return statement in hasRichheader is triggered with your exe. |
It goes through the whole loop to determine roffset, doesn't find the magic value 0x68636952, and returns 0. https://github.com/milostosic/rdebug/blob/master/src/symbols.cpp#L84 Here's the values it did read: 0x0eba1f0e
Unfortunately I do not. I've never delved into the internals of the PE file format before. :( But here's what ChatGPT suggested? :) https://chat.openai.com/share/1a419c22-24e9-4312-8ed0-c1e3f92f103d |
The 'rich header' appears to be an artifact of link.exe. Binaries linked with lld-link.exe (despite objects being compiled with msvc) do not seem to possess it. |
symbolResolverCreate
has some logic to determine what type of compiler/toolchain was used. The functionhasRichheader
is used to determine whether MSVC or GCC was used on Windows.The function
hasRichHeader
is pure magic with no documentation. Unfortunately it appears to be an incomplete function. For myexe
that function is returning false and the GCC toolchain is selected. This results in no symbols being loaded for my binary.However my binary was built by MSVC. And if I modify source to force the toolchain to MSVC the symbols are correctly loaded. I'm not sure what
hasRichHeader
is doing wrong.Unfortunately I can not share my exe as it's is proprietary and internal. :(
The text was updated successfully, but these errors were encountered: