diff options
author | Zachary Turner <zturner@google.com> | 2015-01-22 18:59:05 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2015-01-22 18:59:05 +0000 |
commit | 5e6f45201f0b62c1e7a24fc396f3ea6e10dc880d (patch) | |
tree | 6cc98b6be3da45381cb35092b3be5d6846dff874 /lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp | |
parent | a7bdc7e6718219d9585659a5329851a69759626d (diff) | |
download | bcm5719-llvm-5e6f45201f0b62c1e7a24fc396f3ea6e10dc880d.tar.gz bcm5719-llvm-5e6f45201f0b62c1e7a24fc396f3ea6e10dc880d.zip |
Don't stomp the triple when loading a PECOFF target.
When you create a target, it tries to look for the platform's list
of supported architectures for a match. The match it finds can
contain specific triples, like i386-pc-windows-msvc. Later, we
overwrite this value with the most generic triple that can apply
to any platform with COFF support, causing some of the fields of
the triple to get overwritten.
This patch changes the behavior to only merge in values from the COFF
triple if the fields of the matching triple were unknown/unspecified
to begin with.
This fixes load address resolution on Windows, since it enables the
DynamicLoaderWindows to be used instead of DynamicLoaderStatic.
Reviewed by: Greg Clayton
Differential Revision: http://reviews.llvm.org/D7120
llvm-svn: 226849
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp')
-rw-r--r-- | lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp index 4f9ed2e8158..6defd643a43 100644 --- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp +++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp @@ -130,10 +130,17 @@ ObjectFilePECOFF::GetModuleSpecifications (const lldb_private::FileSpec& file, { ArchSpec spec; if (coff_header.machine == MachineAmd64) + { spec.SetTriple("x86_64-pc-windows"); + specs.Append(ModuleSpec(file, spec)); + } else if (coff_header.machine == MachineX86) + { spec.SetTriple("i386-pc-windows"); - specs.Append(ModuleSpec(file, spec)); + specs.Append(ModuleSpec(file, spec)); + spec.SetTriple("i686-pc-windows"); + specs.Append(ModuleSpec(file, spec)); + } } } } |