[llvm-branch-commits] [llvm] [SHT_LLVM_FUNC_MAP][llvm-readobj]Introduce function address map section and emit dynamic instruction count(readobj part) (PR #124333)

James Henderson via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Feb 19 01:14:14 PST 2025


================
@@ -940,6 +940,92 @@ ELFFile<ELFT>::decodeBBAddrMap(const Elf_Shdr &Sec, const Elf_Shdr *RelaSec,
   return std::move(AddrMapsOrErr);
 }
 
+template <class ELFT>
+Expected<std::vector<FuncMap>>
+ELFFile<ELFT>::decodeFuncMap(const Elf_Shdr &Sec,
+                             const Elf_Shdr *RelaSec) const {
+  bool IsRelocatable = this->getHeader().e_type == ELF::ET_REL;
----------------
jh7370 wrote:

Do we really need this check? Would not the value of `RelaSec` (`nullptr` or otherwise) be sufficient?

https://github.com/llvm/llvm-project/pull/124333


More information about the llvm-branch-commits mailing list