Remove usages of host architecture within ELF object file for unknown parts of ArchSpec.
http://reviews.llvm.org/D9078 llvm-svn: 235255
This commit is contained in:
@@ -27,7 +27,6 @@
|
||||
#include "lldb/Symbol/SymbolContext.h"
|
||||
#include "lldb/Target/SectionLoadList.h"
|
||||
#include "lldb/Target/Target.h"
|
||||
#include "lldb/Host/HostInfo.h"
|
||||
|
||||
#include "llvm/ADT/PointerUnion.h"
|
||||
#include "llvm/ADT/StringRef.h"
|
||||
@@ -673,14 +672,7 @@ ObjectFileELF::GetModuleSpecifications (const lldb_private::FileSpec& file,
|
||||
|
||||
GetSectionHeaderInfo(section_headers, data, header, uuid, gnu_debuglink_file, gnu_debuglink_crc, spec.GetArchitecture ());
|
||||
|
||||
// If the module vendor is not set and the module OS matches this host OS, set the module vendor to the host vendor.
|
||||
llvm::Triple &spec_triple = spec.GetArchitecture ().GetTriple ();
|
||||
if (spec_triple.getVendor () == llvm::Triple::VendorType::UnknownVendor)
|
||||
{
|
||||
const llvm::Triple &host_triple = HostInfo::GetArchitecture().GetTriple();
|
||||
if (spec_triple.getOS () == host_triple.getOS ())
|
||||
spec_triple.setVendor (host_triple.getVendor ());
|
||||
}
|
||||
|
||||
if (log)
|
||||
log->Printf ("ObjectFileELF::%s file '%s' module set to triple: %s (architecture %s)", __FUNCTION__, file.GetPath ().c_str (), spec_triple.getTriple ().c_str (), spec.GetArchitecture ().GetArchitectureName ());
|
||||
@@ -1392,30 +1384,6 @@ ObjectFileELF::GetSectionHeaderInfo(SectionHeaderColl §ion_headers,
|
||||
{
|
||||
const uint32_t sub_type = subTypeFromElfHeader(header);
|
||||
arch_spec.SetArchitecture (eArchTypeELF, header.e_machine, sub_type);
|
||||
|
||||
switch (arch_spec.GetAddressByteSize())
|
||||
{
|
||||
case 4:
|
||||
{
|
||||
const ArchSpec host_arch32 = HostInfo::GetArchitecture(HostInfo::eArchKind32);
|
||||
if (host_arch32.GetCore() == arch_spec.GetCore())
|
||||
{
|
||||
arch_spec.GetTriple().setOSName(HostInfo::GetOSString().data());
|
||||
arch_spec.GetTriple().setVendorName(HostInfo::GetVendorString().data());
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
{
|
||||
const ArchSpec host_arch64 = HostInfo::GetArchitecture(HostInfo::eArchKind64);
|
||||
if (host_arch64.GetCore() == arch_spec.GetCore())
|
||||
{
|
||||
arch_spec.GetTriple().setOSName(HostInfo::GetOSString().data());
|
||||
arch_spec.GetTriple().setVendorName(HostInfo::GetVendorString().data());
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// If there are no section headers we are done.
|
||||
|
||||
Reference in New Issue
Block a user