[llvm] [llvm-objcopy] Add llvm-objcopy option --set-visibility-sym (PR #80872)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 8 00:38:56 PST 2024


================
@@ -290,6 +290,9 @@ static Error updateAndRemoveSymbols(const CommonConfig &Config,
     return Error::success();
 
   Obj.SymbolTable->updateSymbols([&](Symbol &Sym) {
+    if (ELFConfig.SymbolsToSetVisibility.matches(Sym.Name) &&
----------------
jh7370 wrote:

Ordering is hard :) I feel like the new visibility may want setting after other options have been handled that rely on visibility. For example, I think --localize-hidden should operate on symbols with hidden visibility before any change. What do you think?

Regardless of the final order, I think it would be useful to have a test case that shows what happens when you set the visibility of a symbol and also use --localize-hidden, to demonstrate the order.

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


More information about the llvm-commits mailing list