Lines Matching defs:Elf_Shdr
238 std::string describe(const Elf_Shdr &Sec) const;
273 const Elf_Shdr *findSectionByName(StringRef Name) const;
278 virtual void printVersionSymbolSection(const Elf_Shdr *Sec) = 0;
279 virtual void printVersionDefinitionSection(const Elf_Shdr *Sec) = 0;
280 virtual void printVersionDependencySection(const Elf_Shdr *Sec) = 0;
283 printDependentLibsHelper(function_ref<void(const Elf_Shdr &)> OnSectionStart,
291 const Elf_Shdr &Sec, const Elf_Shdr *SymTab);
294 void printRelocationsHelper(const Elf_Shdr &Sec);
296 const Elf_Shdr &Sec,
298 const Elf_Shdr &, const Elf_Shdr *)>
301 virtual void printSymtabMessage(const Elf_Shdr *Symtab, size_t Offset,
326 getVersionTable(const Elf_Shdr &Sec, ArrayRef<Elf_Sym> *SymTab,
327 StringRef *StrTab, const Elf_Shdr **SymTabSec) const;
328 StringRef getPrintableSectionName(const Elf_Shdr &Sec) const;
337 uint64_t SymValue, std::optional<const Elf_Shdr *> FunctionSec);
339 std::optional<const Elf_Shdr *> FunctionSec,
340 const Elf_Shdr &StackSizeSec, DataExtractor Data,
342 void printStackSize(const Relocation<ELFT> &R, const Elf_Shdr &RelocSec,
343 unsigned Ndx, const Elf_Shdr *SymTab,
344 const Elf_Shdr *FunctionSec, const Elf_Shdr &StackSizeSec,
371 std::pair<const Elf_Phdr *, const Elf_Shdr *> findDynamic();
390 const Elf_Shdr *DotSymtabSec = nullptr;
391 const Elf_Shdr *DotDynsymSec = nullptr;
392 const Elf_Shdr *DotAddrsigSec = nullptr;
393 DenseMap<const Elf_Shdr *, ArrayRef<Elf_Word>> ShndxTables;
397 const Elf_Shdr *SymbolVersionSection = nullptr; // .gnu.version
398 const Elf_Shdr *SymbolVersionNeedSection = nullptr; // .gnu.version_r
399 const Elf_Shdr *SymbolVersionDefSection = nullptr; // .gnu.version_d
418 const Elf_Shdr *SymTab) const;
420 ArrayRef<Elf_Word> getShndxTable(const Elf_Shdr *Symtab) const;
427 std::string ELFDumper<ELFT>::describe(const Elf_Shdr &Sec) const {
477 ELFDumper<ELFT>::getVersionTable(const Elf_Shdr &Sec, ArrayRef<Elf_Sym> *SymTab,
479 const Elf_Shdr **SymTabSec) const {
543 const Elf_Shdr *SymtabSec = IsDynamic ? DotDynsymSec : DotSymtabSec;
599 void printSymtabMessage(const Elf_Shdr *Symtab, size_t Offset,
604 void printVersionSymbolSection(const Elf_Shdr *Sec) override;
605 void printVersionDefinitionSection(const Elf_Shdr *Sec) override;
606 void printVersionDependencySection(const Elf_Shdr *Sec) override;
670 void printRelr(const Elf_Shdr &Sec);
715 void printVersionSymbolSection(const Elf_Shdr *Sec) override;
716 void printVersionDefinitionSection(const Elf_Shdr *Sec) override;
717 void printVersionDependencySection(const Elf_Shdr *Sec) override;
762 virtual void printRelocationSectionInfo(const Elf_Shdr &Sec, StringRef Name,
790 void printRelocationSectionInfo(const Elf_Shdr &Sec, StringRef Name,
897 const Elf_Shdr *SymTab) const {
925 ELFDumper<ELFT>::getShndxTable(const Elf_Shdr *Symtab) const {
1048 Expected<const Elf_Shdr *> SecOrErr = Obj.getSection(SectionIndex);
1055 static const typename ELFO::Elf_Shdr *
1058 for (const typename ELFO::Elf_Shdr &Shdr : cantFail(Obj.sections()))
1800 const Elf_Shdr *DynamicSec = nullptr;
1801 for (const Elf_Shdr &Sec : cantFail(Obj.sections())) {
1841 const Elf_Shdr *DynamicSec;
1933 for (const Elf_Shdr &Sec : Sections) {
2307 for (const Elf_Shdr &Shdr : cantFail(Obj.sections())) {
2917 for (const Elf_Shdr &Sec : cantFail(Obj.sections())) {
2982 const Elf_Shdr *getPltSymTable() const { return PltSymTable; }
2985 const Elf_Shdr *GotSec;
2989 const Elf_Shdr *PltSec;
2990 const Elf_Shdr *PltRelSec;
2991 const Elf_Shdr *PltSymTable;
3126 if (Expected<const Elf_Shdr *> PltSymTableOrErr =
3337 const Elf_Shdr *RegInfoSec = findSectionByName(".reginfo");
3401 const Elf_Shdr *MipsOpts = findSectionByName(".MIPS.options");
3438 const Elf_Shdr *StackMapSection = findSectionByName(".llvm_stackmaps");
3466 const Elf_Shdr &Sec, const Elf_Shdr *SymTab) {
3711 const Elf_Shdr &Symtab) -> StringRef {
3735 for (const Elf_Shdr &Sec : cantFail(Obj.sections())) {
3741 if (Expected<const Elf_Shdr *> SymtabOrErr = Obj.getSection(Sec.sh_link)) {
3782 if (Expected<const Elf_Shdr *> SecOrErr = Obj.getSection(Ndx)) {
3912 auto PrintAsRelr = [&](const Elf_Shdr &Sec) {
3918 auto GetEntriesNum = [&](const Elf_Shdr &Sec) -> Expected<size_t> {
3952 for (const Elf_Shdr &Sec : cantFail(this->Obj.sections())) {
3991 template <class ELFT> void GNUELFDumper<ELFT>::printRelr(const Elf_Shdr &Sec) {
4114 ArrayRef<Elf_Shdr> Sections = cantFail(this->Obj.sections());
4145 for (const Elf_Shdr &Sec : Sections) {
4184 void GNUELFDumper<ELFT>::printSymtabMessage(const Elf_Shdr *Symtab,
4527 ArrayRef<Elf_Shdr> Sections = cantFail(this->Obj.sections());
4570 for (const Elf_Shdr &S : Sections) {
4795 DenseSet<const Elf_Shdr *> BelongsToSegment;
4810 for (const Elf_Shdr &Sec : cantFail(this->Obj.sections())) {
4832 for (const Elf_Shdr &Sec : cantFail(this->Obj.sections())) {
4939 void ELFDumper<ELFT>::printRelocationsHelper(const Elf_Shdr &Sec) {
4941 Sec, [&](const Relocation<ELFT> &R, unsigned Ndx, const Elf_Shdr &Sec,
4942 const Elf_Shdr *SymTab) { printReloc(R, Ndx, Sec, SymTab); });
5038 void GNUELFDumper<ELFT>::printVersionSymbolSection(const Elf_Shdr *Sec) {
5123 void GNUELFDumper<ELFT>::printVersionDefinitionSection(const Elf_Shdr *Sec) {
5150 void GNUELFDumper<ELFT>::printVersionDependencySection(const Elf_Shdr *Sec) {
6411 function_ref<void(const Elf_Shdr &)> OnSectionStart,
6419 for (const Elf_Shdr &Shdr : cantFail(Obj.sections())) {
6448 const Elf_Shdr &Sec,
6450 const Elf_Shdr &, const Elf_Shdr *)>
6461 const Elf_Shdr *SymTab;
6465 Expected<const Elf_Shdr *> SymTabOrErr = Obj.getSection(Sec.sh_link);
6533 StringRef ELFDumper<ELFT>::getPrintableSectionName(const Elf_Shdr &Sec) const {
6563 auto OnSectionStart = [&](const Elf_Shdr &Shdr) {
6581 uint64_t SymValue, std::optional<const Elf_Shdr *> FunctionSec) {
6624 if (Expected<const Elf_Shdr *> SecOrErr =
6647 uint64_t SymValue, std::optional<const Elf_Shdr *> FunctionSec,
6648 const Elf_Shdr &StackSizeSec, DataExtractor Data, uint64_t *Offset) {
6691 const Elf_Shdr &RelocSec, unsigned Ndx,
6692 const Elf_Shdr *SymTab,
6693 const Elf_Shdr *FunctionSec,
6694 const Elf_Shdr &StackSizeSec,
6710 Expected<const Elf_Shdr *> SectionOrErr =
6747 for (const Elf_Shdr &Sec : cantFail(Obj.sections())) {
6777 auto IsMatch = [&](const Elf_Shdr &Sec) -> bool {
6787 Expected<MapVector<const Elf_Shdr *, const Elf_Shdr *>>
6797 const Elf_Shdr *StackSizesELFSec = StackSizeMapEntry.first;
6798 const Elf_Shdr *RelocSec = StackSizeMapEntry.second;
6812 const Elf_Shdr *FunctionSec = unwrapOrError(
6824 const Elf_Shdr &Sec, const Elf_Shdr *SymTab) {
7217 for (const Elf_Shdr &Sec : cantFail(this->Obj.sections())) {
7252 void LLVMELFDumper<ELFT>::printRelocationSectionInfo(const Elf_Shdr &Sec,
7286 for (const Elf_Shdr &Sec : cantFail(this->Obj.sections())) {
7319 const Elf_Shdr *SymSec = unwrapOrError(
7577 void LLVMELFDumper<ELFT>::printVersionSymbolSection(const Elf_Shdr *Sec) {
7584 const Elf_Shdr *SymTabSec;
7611 void LLVMELFDumper<ELFT>::printVersionDefinitionSection(const Elf_Shdr *Sec) {
7636 void LLVMELFDumper<ELFT>::printVersionDependencySection(const Elf_Shdr *Sec) {
7738 auto IsMatch = [](const Elf_Shdr &Sec) -> bool {
7742 Expected<MapVector<const Elf_Shdr *, const Elf_Shdr *>> SecToRelocMapOrErr =
7751 const Elf_Shdr *CGSection = CGMapEntry.first;
7752 const Elf_Shdr *CGRelSection = CGMapEntry.second;
7790 using Elf_Shdr = typename ELFT::Shdr;
7791 auto IsMatch = [](const Elf_Shdr &Sec) -> bool {
7794 Expected<MapVector<const Elf_Shdr *, const Elf_Shdr *>> SecRelocMapOrErr =
7803 std::optional<const Elf_Shdr *> FunctionSec;
8116 for (const Elf_Shdr &Shdr : cantFail(this->Obj.sections())) {
8159 [](const Elf_Shdr &) {},
8352 void JSONELFDumper<ELFT>::printRelocationSectionInfo(const Elf_Shdr &Sec,