[llvm] 4ba1f04 - [JITLink] Remove overly-restrictive visibility check introduced in 75404e9ef88.

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 26 11:20:03 PDT 2022


Author: Lang Hames
Date: 2022-09-26T11:19:40-07:00
New Revision: 4ba1f04465859fc56514bd4dca21066eea595294

URL: https://github.com/llvm/llvm-project/commit/4ba1f04465859fc56514bd4dca21066eea595294
DIFF: https://github.com/llvm/llvm-project/commit/4ba1f04465859fc56514bd4dca21066eea595294.diff

LOG: [JITLink] Remove overly-restrictive visibility check introduced in 75404e9ef88.

ELF undefined symbols can have non-default visibility.

Added: 
    

Modified: 
    llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h

Removed: 
    


################################################################################
diff  --git a/llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h b/llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h
index b9e0c2966b1a9..b6c2b746c7ec8 100644
--- a/llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h
+++ b/llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h
@@ -469,13 +469,6 @@ template <typename ELFT> Error ELFLinkGraphBuilder<ELFT>::graphifySymbols() {
                 " for external symbol " + *Name,
             inconvertibleErrorCode());
 
-      if (Sym.getVisibility() != ELF::STV_DEFAULT)
-        return make_error<StringError>(
-            "Invalid symbol visibility " +
-                Twine(static_cast<int>(Sym.getVisibility())) +
-                " for external symbol " + *Name,
-            inconvertibleErrorCode());
-
       // If L is Linkage::Weak that means this is a weakly referenced symbol.
       auto &GSym = G->addExternalSymbol(*Name, Sym.st_size,
                                         Sym.getBinding() == ELF::STB_WEAK);


        


More information about the llvm-commits mailing list