diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp index 2970ea84216939..a7f455f278b3aa 100644 --- a/lld/ELF/Driver.cpp +++ b/lld/ELF/Driver.cpp @@ -1754,7 +1754,8 @@ static void setConfigs(opt::InputArgList &args) { // builds and disabled otherwise. This check is enabled when writeAddends is // true. #ifndef NDEBUG - bool checkDynamicRelocsDefault = true; + // The SBF and BPF target for Solana do not support checking dynamic relocs. + bool checkDynamicRelocsDefault = m != EM_BPF && m != EM_SBF; #else bool checkDynamicRelocsDefault = false; #endif