#include <cstdlib>
#include <iterator>
#include <memory>
+#include <optional>
#include <string>
#include <system_error>
#include <vector>
const Elf_Shdr *DotDynsymSec = nullptr;
const Elf_Shdr *DotAddrsigSec = nullptr;
DenseMap<const Elf_Shdr *, ArrayRef<Elf_Word>> ShndxTables;
- Optional<uint64_t> SONameOffset;
- Optional<DenseMap<uint64_t, std::vector<uint32_t>>> AddressToIndexMap;
+ std::optional<uint64_t> SONameOffset;
+ std::optional<DenseMap<uint64_t, std::vector<uint32_t>>> AddressToIndexMap;
const Elf_Shdr *SymbolVersionSection = nullptr; // .gnu.version
const Elf_Shdr *SymbolVersionNeedSection = nullptr; // .gnu.version_r
if (Ndx != SHN_UNDEF && Ndx < SHN_LORESERVE)
return Ndx;
- auto CreateErr = [&](const Twine &Name, Optional<unsigned> Offset = None) {
+ auto CreateErr = [&](const Twine &Name,
+ std::optional<unsigned> Offset = None) {
std::string Desc;
if (Offset)
Desc = (Name + "+0x" + Twine::utohexstr(*Offset)).str();
}
// Lookup dynamic table tags which define the GOT layout.
- Optional<uint64_t> DtPltGot;
- Optional<uint64_t> DtLocalGotNum;
- Optional<uint64_t> DtGotSym;
+ std::optional<uint64_t> DtPltGot;
+ std::optional<uint64_t> DtLocalGotNum;
+ std::optional<uint64_t> DtGotSym;
for (const auto &Entry : DynTable) {
switch (Entry.getTag()) {
case ELF::DT_PLTGOT:
template <class ELFT>
Error MipsGOTParser<ELFT>::findPLT(Elf_Dyn_Range DynTable) {
// Lookup dynamic table tags which define the PLT layout.
- Optional<uint64_t> DtMipsPltGot;
- Optional<uint64_t> DtJmpRel;
+ std::optional<uint64_t> DtMipsPltGot;
+ std::optional<uint64_t> DtJmpRel;
for (const auto &Entry : DynTable) {
switch (Entry.getTag()) {
case ELF::DT_MIPS_PLTGOT: