[PATCH] D77704: [gold] Add support for loading pass plugins

Dominic Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 15 16:34:12 PDT 2020


ddcc marked an inline comment as done.
ddcc added inline comments.


================
Comment at: llvm/tools/gold/CMakeLists.txt:1
 set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/gold.exports)
 
----------------
efriedma wrote:
> Oh, duh, I just realized the problem with the symbol exports.  The LLVM_EXPORTED_SYMBOL_FILE line suppresses exporting all the symbols pass plugins would normally use.
> 
> (And I should have realized export_executable_symbols_for_plugins shouldn't be necessary for a shared library: shared libraries export all symbols by default.)
Hmm, I tried both with and without `LLVM_EXPORTED_SYMBOL_FILE`, but it didn't seem to make a difference.

I think the fundamental problem here is that when gold calls `dlopen(LLVMgold.so, RTLD_LAZY)`, it doesn't load provide the `RTLD_GLOBAL` argument, so any symbols in `LLVMgold.so` aren't available to subsequent dynamically-loaded plugins.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77704/new/

https://reviews.llvm.org/D77704





More information about the llvm-commits mailing list