[clang] [llvm] [MC,llvm-readobj,yaml2obj] Support CREL relocation format (PR #91280)

Peter Smith via cfe-commits cfe-commits at lists.llvm.org
Thu May 9 06:51:16 PDT 2024


================
@@ -1022,6 +1027,40 @@ ELFObjectFile<ELFT>::section_rel_begin(DataRefImpl Sec) const {
   uintptr_t SHT = reinterpret_cast<uintptr_t>((*SectionsOrErr).begin());
   RelData.d.a = (Sec.p - SHT) / EF.getHeader().e_shentsize;
   RelData.d.b = 0;
+  if (reinterpret_cast<const Elf_Shdr *>(Sec.p)->sh_type == ELF::SHT_CREL) {
----------------
smithp35 wrote:

Is there scope for a forwards iterator that decodes a CREL when dereferenced or incremented. That could be used in a thread-safe environment and wouldn't take up a lot of memory.

May need to be under a different interface.

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


More information about the cfe-commits mailing list