aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectTarget.cpp
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2022-06-21 15:31:32 +0300
committerMartin Storsjö <martin@martin.st>2022-06-22 17:16:05 +0300
commit8a64dd5b06146f073a4a326f0e24fa18e571b281 (patch)
treedbd02211243de1bb45f85105ee77c440da361b78 /lldb/source/Commands/CommandObjectTarget.cpp
parent17e27025287b96026a4351e1d73931bb0c76dac2 (diff)
downloadllvm-8a64dd5b06146f073a4a326f0e24fa18e571b281.zip
llvm-8a64dd5b06146f073a4a326f0e24fa18e571b281.tar.gz
llvm-8a64dd5b06146f073a4a326f0e24fa18e571b281.tar.bz2
[lldb] Fix reading i686-windows executables with GNU environment
25c8a061c5739677d2fc0af29a8cc9520207b923 / D127048 added an option for setting the ABI to GNU. When an object file is loaded, there's only minimal verification done for the architecture spec set for it, if the object file only provides one. However, for i386 object files, the PECOFF object file plugin provides two architectures, i386-pc-windows and i686-pc-windows. This picks a totally different codepath in TargetList::CreateTargetInternal, where it's treated as a fat binary. This goes through more verifications to see if the architectures provided by the object file matches what the platform plugin supports. The PlatformWindows() constructor explicitly adds the "i386-pc-windows" and "i686-pc-windows" architectures (even when running on other architectures), which allows this "fat binary verification" to succeed for the i386 object files that provide two architectures. However, after that commit, if the object file is advertised with the different environment (either when lldb is built in a mingw environment, or if that setting is set), the fat binary validation won't accept the file any longer. Update ArchSpec::IsEqualTo with more logic for the Windows use cases; mismatching vendors is not an issue (they don't have any practical effect on Windows), and GNU and MSVC environments are compatible to the point that PlatformWindows can handle object files for both environments/ABIs. As a separate path forward, one could also consider to stop returning two architecture specs from ObjectFilePECOFF::GetModuleSpecifications for i386 files. Differential Revision: https://reviews.llvm.org/D128268
Diffstat (limited to 'lldb/source/Commands/CommandObjectTarget.cpp')
0 files changed, 0 insertions, 0 deletions