[llvm-branch-commits] [llvm-objdump] -r: support CREL (PR #97382)

Peter Smith via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Jul 2 05:50:04 PDT 2024


================
@@ -1453,6 +1525,15 @@ template <class ELFT> bool ELFObjectFile<ELFT>::isRelocatableObject() const {
   return EF.getHeader().e_type == ELF::ET_REL;
 }
 
+template <class ELFT>
+StringRef ELFObjectFile<ELFT>::getCrelError(DataRefImpl Sec) const {
+  uintptr_t SHT = reinterpret_cast<uintptr_t>(cantFail(EF.sections()).begin());
+  auto I = (Sec.p - SHT) / EF.getHeader().e_shentsize;
+  if (I < CrelErrs.size())
+    return CrelErrs[I];
+  return "";
----------------
smithp35 wrote:

Wouldn't this be an error (or perhaps internal error) for an out of bounds access?

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


More information about the llvm-branch-commits mailing list