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

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sun May 19 11:38:08 PDT 2024


================
@@ -1278,29 +1285,69 @@ void ELFState<ELFT>::writeSectionContent(
   if (!Section.Relocations)
     return;
 
+  const bool IsCrel = Section.Type == llvm::ELF::SHT_CREL;
   const bool IsRela = Section.Type == llvm::ELF::SHT_RELA;
+  typename ELFT::uint OffsetMask = 8, Offset = 0, Addend = 0;
+  uint32_t Symidx = 0, Type = 0;
+  uint64_t CurrentOffset = CBA.getOffset();
+  if (IsCrel)
----------------
MaskRay wrote:

The comments in ELFObjectWriter.cpp and ELFEmitter.cpp are the same. The one in ELFEmitter.cpp is indended more, leading to a difference in text wrapping.

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


More information about the llvm-commits mailing list