aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/lib/Object/ELFObjectFile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Object/ELFObjectFile.cpp')
-rw-r--r--contrib/llvm-project/llvm/lib/Object/ELFObjectFile.cpp38
1 files changed, 5 insertions, 33 deletions
diff --git a/contrib/llvm-project/llvm/lib/Object/ELFObjectFile.cpp b/contrib/llvm-project/llvm/lib/Object/ELFObjectFile.cpp
index bf6ffd6c37b9..c7b715793048 100644
--- a/contrib/llvm-project/llvm/lib/Object/ELFObjectFile.cpp
+++ b/contrib/llvm-project/llvm/lib/Object/ELFObjectFile.cpp
@@ -43,16 +43,7 @@ const EnumEntry<unsigned> llvm::object::ElfSymbolTypes[NumElfSymbolTypes] = {
{"File", "FILE", ELF::STT_FILE},
{"Common", "COMMON", ELF::STT_COMMON},
{"TLS", "TLS", ELF::STT_TLS},
- {"Unknown", "<unknown>: 7", 7},
- {"Unknown", "<unknown>: 8", 8},
- {"Unknown", "<unknown>: 9", 9},
- {"GNU_IFunc", "IFUNC", ELF::STT_GNU_IFUNC},
- {"OS Specific", "<OS specific>: 11", 11},
- {"OS Specific", "<OS specific>: 12", 12},
- {"Proc Specific", "<processor specific>: 13", 13},
- {"Proc Specific", "<processor specific>: 14", 14},
- {"Proc Specific", "<processor specific>: 15", 15}
-};
+ {"GNU_IFunc", "IFUNC", ELF::STT_GNU_IFUNC}};
ELFObjectFileBase::ELFObjectFileBase(unsigned int Type, MemoryBufferRef Source)
: ObjectFile(Type, Source) {}
@@ -63,7 +54,7 @@ createPtr(MemoryBufferRef Object) {
auto Ret = ELFObjectFile<ELFT>::create(Object);
if (Error E = Ret.takeError())
return std::move(E);
- return std::make_unique<ELFObjectFile<ELFT>>(std::move(*Ret));
+ return make_unique<ELFObjectFile<ELFT>>(std::move(*Ret));
}
Expected<std::unique_ptr<ObjectFile>>
@@ -203,7 +194,7 @@ SubtargetFeatures ELFObjectFileBase::getARMFeatures() const {
default:
break;
case ARMBuildAttrs::Not_Allowed:
- Features.AddFeature("vfp2sp", false);
+ Features.AddFeature("vfp2d16sp", false);
Features.AddFeature("vfp3d16sp", false);
Features.AddFeature("vfp4d16sp", false);
break;
@@ -356,21 +347,6 @@ 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())
@@ -407,13 +383,9 @@ ELFObjectFileBase::getPltAddresses() const {
return {};
Optional<SectionRef> Plt = None, RelaPlt = None, GotPlt = None;
for (const SectionRef &Section : sections()) {
- Expected<StringRef> NameOrErr = Section.getName();
- if (!NameOrErr) {
- consumeError(NameOrErr.takeError());
+ StringRef Name;
+ if (Section.getName(Name))
continue;
- }
- StringRef Name = *NameOrErr;
-
if (Name == ".plt")
Plt = Section;
else if (Name == ".rela.plt" || Name == ".rel.plt")