Lines Matching refs:hdr
494 // Align hdr.n_descsz to next power multiple of 4. See man 5 elf.
676 bool DfxElf::FillUnwindTableByEhhdrLocal(struct DwarfEhFrameHdr* hdr, struct UnwindTableInfo* uti)
678 if (hdr == nullptr) {
681 if (hdr->version != DW_EH_VERSION) {
682 DFXLOGE("[%{public}d]: version(%{public}d) error", __LINE__, hdr->version);
686 uintptr_t ptr = (uintptr_t)(&(hdr->ehFrame));
687 DFXLOGU("[%{public}d]: hdr: %{public}" PRIx64 ", ehFrame: %{public}" PRIx64 "", __LINE__,
688 (uint64_t)hdr, (uint64_t)ptr);
693 (uint64_t)uti->gp, hdr->ehFramePtrEnc, hdr->fdeCountEnc);
695 MAYBE_UNUSED uintptr_t ehFrameStart = memory->ReadEncodedValue(ptr, hdr->ehFramePtrEnc);
696 uintptr_t fdeCount = memory->ReadEncodedValue(ptr, hdr->fdeCountEnc);
700 if (hdr->tableEnc != (DW_EH_PE_datarel | DW_EH_PE_sdata4)) {
701 DFXLOGU("[%{public}d]: tableEnc: %{public}x", __LINE__, hdr->tableEnc);
702 if (hdr->fdeCountEnc == DW_EH_PE_omit) {
705 if (hdr->ehFramePtrEnc == DW_EH_PE_omit) {
706 DFXLOGE("[%{public}d]: ehFramePtrEnc(%{public}x) error", __LINE__, hdr->ehFramePtrEnc);
716 uti->segbase = (uintptr_t)hdr;
725 bool DfxElf::FillUnwindTableByEhhdr(struct DwarfEhFrameHdr* hdr, uintptr_t shdrBase, struct UnwindTableInfo* uti)
727 if ((hdr == nullptr) || (uti == nullptr)) {
730 if (hdr->version != DW_EH_VERSION) {
731 DFXLOGE("[%{public}d]: version(%{public}d) error", __LINE__, hdr->version);
734 uintptr_t ptr = (uintptr_t)(&(hdr->ehFrame));
735 DFXLOGU("[%{public}d]: hdr: %{public}" PRIx64 ", ehFrame: %{public}" PRIx64 "", __LINE__,
736 (uint64_t)hdr, (uint64_t)ptr);
740 (uint64_t)uti->gp, hdr->ehFramePtrEnc, hdr->fdeCountEnc);
743 MAYBE_UNUSED uintptr_t ehFrameStart = mmap_->ReadEncodedValue(ptrOffset, hdr->ehFramePtrEnc);
744 uintptr_t fdeCount = mmap_->ReadEncodedValue(ptrOffset, hdr->fdeCountEnc);
749 if (hdr->tableEnc != (DW_EH_PE_datarel | DW_EH_PE_sdata4)) {
750 DFXLOGU("[%{public}d]: tableEnc: %{public}x", __LINE__, hdr->tableEnc);
751 if (hdr->fdeCountEnc == DW_EH_PE_omit) {
754 if (hdr->ehFramePtrEnc == DW_EH_PE_omit) {
755 DFXLOGE("[%{public}d]: ehFramePtrEnc(%{public}x) error", __LINE__, hdr->ehFramePtrEnc);
765 uti->tableData = shdrBase + ptr - (uintptr_t)hdr;
801 struct DwarfEhFrameHdr* hdr = nullptr;
805 hdr = (struct DwarfEhFrameHdr *) (shdr.offset + (char *)GetMmapPtr());
816 hdr = &synthHdr;
819 hasTableInfo_ = FillUnwindTableByEhhdr(hdr, shdrBase, &uti);
944 struct DwarfEhFrameHdr *hdr = nullptr;
948 hdr = (struct DwarfEhFrameHdr *) (pEhHdr->p_vaddr + loadBase);
961 hdr = &synthHdr;
964 return FillUnwindTableByEhhdrLocal(hdr, uti);
999 DFXLOGD("Invalid elf hdr?");