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

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Thu May 9 23:36:32 PDT 2024


================
@@ -292,6 +293,9 @@ template <class ELFT> class ELFObjectFile : public ELFObjectFileBase {
   const Elf_Shdr *DotSymtabSec = nullptr; // Symbol table section.
   const Elf_Shdr *DotSymtabShndxSec = nullptr; // SHT_SYMTAB_SHNDX section.
 
+  // Hold CREL relocations for SectionRef::relocations().
+  mutable SmallVector<SmallVector<Elf_Crel, 0>, 0> Crels;
----------------
MaskRay wrote:

To the best of my knowledge, ELFObjectFile is not used by multi-threading. The `mutable` member is not nice, which is to comply with the interface requirement by `llvm-objdump -r/-R`.

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


More information about the cfe-commits mailing list