From 1d5ae1026e831016fc29fd927877c86af904481f Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Wed, 23 Oct 2019 17:51:42 +0000 Subject: Vendor import of stripped llvm trunk r375505, the last commit before the upstream Subversion repository was made read-only, and the LLVM project migrated to GitHub: https://llvm.org/svn/llvm-project/llvm/trunk@375505 --- lib/Object/ELFObjectFile.cpp | 38 +++++++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) (limited to 'lib/Object/ELFObjectFile.cpp') diff --git a/lib/Object/ELFObjectFile.cpp b/lib/Object/ELFObjectFile.cpp index c7b715793048c..bf6ffd6c37b95 100644 --- a/lib/Object/ELFObjectFile.cpp +++ b/lib/Object/ELFObjectFile.cpp @@ -43,7 +43,16 @@ const EnumEntry llvm::object::ElfSymbolTypes[NumElfSymbolTypes] = { {"File", "FILE", ELF::STT_FILE}, {"Common", "COMMON", ELF::STT_COMMON}, {"TLS", "TLS", ELF::STT_TLS}, - {"GNU_IFunc", "IFUNC", ELF::STT_GNU_IFUNC}}; + {"Unknown", ": 7", 7}, + {"Unknown", ": 8", 8}, + {"Unknown", ": 9", 9}, + {"GNU_IFunc", "IFUNC", ELF::STT_GNU_IFUNC}, + {"OS Specific", ": 11", 11}, + {"OS Specific", ": 12", 12}, + {"Proc Specific", ": 13", 13}, + {"Proc Specific", ": 14", 14}, + {"Proc Specific", ": 15", 15} +}; ELFObjectFileBase::ELFObjectFileBase(unsigned int Type, MemoryBufferRef Source) : ObjectFile(Type, Source) {} @@ -54,7 +63,7 @@ createPtr(MemoryBufferRef Object) { auto Ret = ELFObjectFile::create(Object); if (Error E = Ret.takeError()) return std::move(E); - return make_unique>(std::move(*Ret)); + return std::make_unique>(std::move(*Ret)); } Expected> @@ -194,7 +203,7 @@ SubtargetFeatures ELFObjectFileBase::getARMFeatures() const { default: break; case ARMBuildAttrs::Not_Allowed: - Features.AddFeature("vfp2d16sp", false); + Features.AddFeature("vfp2sp", false); Features.AddFeature("vfp3d16sp", false); Features.AddFeature("vfp4d16sp", false); break; @@ -347,6 +356,21 @@ void ELFObjectFileBase::setARMSubArch(Triple &TheTriple) const { case ARMBuildAttrs::v7E_M: Triple += "v7em"; break; + case ARMBuildAttrs::v8_A: + Triple += "v8a"; + break; + case ARMBuildAttrs::v8_R: + Triple += "v8r"; + break; + case ARMBuildAttrs::v8_M_Base: + Triple += "v8m.base"; + break; + case ARMBuildAttrs::v8_M_Main: + Triple += "v8m.main"; + break; + case ARMBuildAttrs::v8_1_M_Main: + Triple += "v8.1m.main"; + break; } } if (!isLittleEndian()) @@ -383,9 +407,13 @@ ELFObjectFileBase::getPltAddresses() const { return {}; Optional Plt = None, RelaPlt = None, GotPlt = None; for (const SectionRef &Section : sections()) { - StringRef Name; - if (Section.getName(Name)) + Expected NameOrErr = Section.getName(); + if (!NameOrErr) { + consumeError(NameOrErr.takeError()); continue; + } + StringRef Name = *NameOrErr; + if (Name == ".plt") Plt = Section; else if (Name == ".rela.plt" || Name == ".rel.plt") -- cgit v1.2.3