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

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 14 01:15:33 PST 2024


https://github.com/jh7370 commented:

Please update the PR title to reflect the revised option name.

@MaskRay, llvm-objcopy (and I presume GNU objcopy) have options to set the binding of a symbol already (although they aren't unconditional, I'll admit). Aside from binding and visibility, what other properties did you have in mind for a possible `--set-symbol-flags`?

@kuilpd, please don't mark items as resolved that I've started, as I use these items to track whether the requested changes have actually been made as I intended. See https://discourse.llvm.org/t/rfc-github-pr-resolve-conversation-button/73178 for more details.

Picking up the thread about multiple values, which is now hidden as "Outdated", I think it makes sense to support this case. If a symbol matches multiple patterns, just have each pattern set it in turn, in the order they appear in the vector. The end result is that the symbol's visibility will match the last visibility that matches. "Last one wins" is a fairly common pattern in option parsing, and I think it therefore generalises to this quite nicely.

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


More information about the llvm-commits mailing list