diff --git a/tools/profiler/core/EHABIStackWalk.cpp b/tools/profiler/core/EHABIStackWalk.cpp index df9c797e860a..e47b0e891f33 100644 --- a/tools/profiler/core/EHABIStackWalk.cpp +++ b/tools/profiler/core/EHABIStackWalk.cpp @@ -107,7 +107,7 @@ bool operator<(const EHEntryHandle &lhs, const EHEntryHandle &rhs) { class EHTable { uint32_t mStartPC; uint32_t mEndPC; - uint32_t mLoadOffset; + uint32_t mBaseAddress; #ifdef HAVE_UNSORTED_EXIDX // In principle we should be able to binary-search the index section in // place, but the ICS toolchain's linker is noncompliant and produces @@ -134,7 +134,7 @@ public: const std::string &name() const { return mName; } uint32_t startPC() const { return mStartPC; } uint32_t endPC() const { return mEndPC; } - uint32_t loadOffset() const { return mLoadOffset; } + uint32_t baseAddress() const { return mBaseAddress; } }; class EHAddrSpace { @@ -548,12 +548,12 @@ EHTable::EHTable(const void *aELF, size_t aSize, const std::string &aName) #endif mName(aName) { - const uint32_t base = reinterpret_cast(aELF); + const uint32_t fileHeaderAddr = reinterpret_cast(aELF); if (aSize < sizeof(Elf32_Ehdr)) return; - const Elf32_Ehdr &file = *(reinterpret_cast(base)); + const Elf32_Ehdr &file = *(reinterpret_cast(fileHeaderAddr)); if (memcmp(&file.e_ident[EI_MAG0], ELFMAG, SELFMAG) != 0 || file.e_ident[EI_CLASS] != ELFCLASS32 || file.e_ident[EI_DATA] != hostEndian || @@ -571,7 +571,7 @@ EHTable::EHTable(const void *aELF, size_t aSize, const std::string &aName) const Elf32_Phdr *exidxHdr = 0, *zeroHdr = 0; for (unsigned i = 0; i < file.e_phnum; ++i) { const Elf32_Phdr &phdr = - *(reinterpret_cast(base + file.e_phoff + *(reinterpret_cast(fileHeaderAddr + file.e_phoff + i * file.e_phentsize)); if (phdr.p_type == PT_ARM_EXIDX) { exidxHdr = &phdr; @@ -589,15 +589,15 @@ EHTable::EHTable(const void *aELF, size_t aSize, const std::string &aName) return; if (!zeroHdr) return; - mLoadOffset = base - zeroHdr->p_vaddr; - mStartPC += mLoadOffset; - mEndPC += mLoadOffset; + mBaseAddress = fileHeaderAddr - zeroHdr->p_vaddr; + mStartPC += mBaseAddress; + mEndPC += mBaseAddress; // Create a sorted index of the index to work around linker bugs. const EHEntry *startTable = - reinterpret_cast(mLoadOffset + exidxHdr->p_vaddr); + reinterpret_cast(mBaseAddress + exidxHdr->p_vaddr); const EHEntry *endTable = - reinterpret_cast(mLoadOffset + exidxHdr->p_vaddr + reinterpret_cast(mBaseAddress + exidxHdr->p_vaddr + exidxHdr->p_memsz); #ifdef HAVE_UNSORTED_EXIDX mEntries.reserve(endTable - startTable);