[lld] [ELF] Support relocatable files using CREL (PR #98115)

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 26 09:02:54 PDT 2024


================
@@ -1433,12 +1434,13 @@ static unsigned handleTlsRelocation(RelType type, Symbol &sym,
   return 0;
 }
 
-template <class ELFT, class RelTy> void RelocationScanner::scanOne(RelTy *&i) {
+template <class ELFT, class RelTy>
+void RelocationScanner::scanOne(typename Relocs<RelTy>::const_iterator &i) {
   const RelTy &rel = *i;
   uint32_t symIndex = rel.getSymbol(config->isMips64EL);
   Symbol &sym = sec->getFile<ELFT>()->getSymbol(symIndex);
   RelType type;
-  if constexpr (ELFT::Is64Bits) {
+  if constexpr (ELFT::Is64Bits || RelTy::IsCrel) {
----------------
smithp35 wrote:

I think this is because misN32Abi doesn't support CREL? could be worth a comment if so.

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


More information about the llvm-commits mailing list