[lld] [llvm] [ELF] Rename IsRela to HasAddend (PR #96592)

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 25 01:12:54 PDT 2024


================
@@ -1010,7 +1010,7 @@ void InputSection::relocateNonAlloc(uint8_t *buf, ArrayRef<RelTy> rels) {
     // For a relocatable link, content relocated by RELA remains unchanged and
     // we can stop here, while content relocated by REL referencing STT_SECTION
     // needs updating implicit addends.
-    if (config->relocatable && (RelTy::IsRela || sym.type != STT_SECTION))
+    if (config->relocatable && (RelTy::HasAddend || sym.type != STT_SECTION))
----------------
smithp35 wrote:

I think the comment above might be worth updating assuming CREL will behave in the same way. Perhaps something like:
```
For a relocatable link, content relocated by relocation types with an explicit addend, such as RELA, remain unchanged and we can stop here. While content relocated by relocation types with an implicit addend, such as REL, needs the implicit addend updated.
``` 

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


More information about the llvm-commits mailing list