| Summary: | objcopy: add support for changing ELF symbol visibility | ||
|---|---|---|---|
| Product: | binutils | Reporter: | Fangrui Song <maskray> |
| Component: | binutils | Assignee: | Not yet assigned to anyone <unassigned> |
| Status: | NEW --- | ||
| Severity: | normal | CC: | brooks, nickc |
| Priority: | P2 | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Host: | Target: | ||
| Build: | Last reconfirmed: | ||
| Project(s) to access: | ssh public key: | ||
|
Description
Fangrui Song
2023-10-26 05:24:25 UTC
On the llvm-objcopy side, someone proposes --set-symbol-visibility: https://github.com/llvm/llvm-project/pull/80872 (In reply to Fangrui Song from comment #1) > On the llvm-objcopy side, someone proposes --set-symbol-visibility: > https://github.com/llvm/llvm-project/pull/80872 The proposal looks like: .. option:: --set-symbol-visibility <symbol>=<visibility_type> Change the visibility of a symbol to the specified type. .. option:: --set-symbols-visibility <filename>=<visibility_type> Reads a list of symbols from <filename> and changes their visibility to the specified type. Visibility types: default, internal, hidden, protected. for ELF targets. (In reply to Fangrui Song from comment #2) > .. option:: --set-symbols-visibility <filename>=<visibility_type> > > Reads a list of symbols from <filename> and changes their visibility to the > specified type. Visibility types: default, internal, hidden, protected. Given the support for "@<file>" for reading in a list of command line options, is the format above really necessary ? Using a file containing lots of: --set-symbol-visibility <symbol>=<vis-type> entries might require a bigger file, but it would also be more flexible, allowing for multiple types of visibility to be set, along with other options as well. Just wanted to mention that the pull request mentioned above to add this to `llvm-objcopy` was merged, and the options are documented (in the source) at https://github.com/llvm/llvm-project/blob/main/llvm/tools/llvm-objcopy/ObjcopyOpts.td#L102. |