W.printNumber("Link", Sec->sh_link);
const typename ELFO::Elf_Shdr *DynSymSec = Dumper->getDotDynSymSec();
- uint8_t *P = (uint8_t *)Obj->base() + Sec->sh_offset;
+ const uint8_t *P = (const uint8_t *)Obj->base() + Sec->sh_offset;
ErrorOr<StringRef> StrTableOrErr =
Obj->getStringTableForSymtab(*DynSymSec);
error(StrTableOrErr.getError());
if (Dyn.d_tag == DT_VERDEFNUM)
verdef_entries = Dyn.d_un.d_val;
}
- uint8_t *SecStartAddress = (uint8_t *)Obj->base() + Sec->sh_offset;
- uint8_t *SecEndAddress = SecStartAddress + Sec->sh_size;
- uint8_t *P = SecStartAddress;
+ const uint8_t *SecStartAddress =
+ (const uint8_t *)Obj->base() + Sec->sh_offset;
+ const uint8_t *SecEndAddress = SecStartAddress + Sec->sh_size;
+ const uint8_t *P = SecStartAddress;
ErrorOr<const typename ELFO::Elf_Shdr *> StrTabOrErr =
Obj->getSection(Sec->sh_link);
error(StrTabOrErr.getError());
W.printNumber("Flags", VD->vd_flags);
W.printNumber("Index", VD->vd_ndx);
W.printNumber("Cnt", VD->vd_cnt);
- W.printString("Name", StringRef((char *)(
- Obj->base() + (*StrTabOrErr)->sh_offset +
- VD->getAux()->vda_name)));
+ W.printString("Name", StringRef((const char *)(Obj->base() +
+ (*StrTabOrErr)->sh_offset +
+ VD->getAux()->vda_name)));
P += VD->vd_next;
}
}
if (entry.isVerdef()) {
// The first Verdaux entry holds the name.
name_offset = entry.getVerdef()->getAux()->vda_name;
- } else {
- name_offset = entry.getVernaux()->vna_name;
- }
-
- // Set IsDefault
- if (entry.isVerdef()) {
IsDefault = !(vs->vs_index & ELF::VERSYM_HIDDEN);
} else {
+ name_offset = entry.getVernaux()->vna_name;
IsDefault = false;
}
-
if (name_offset >= StrTab.size())
reportError("Invalid string offset");
return StringRef(StrTab.data() + name_offset);