https://github.com/yugr/symbolhider
A tool which hides symbols exported from shared libraries or relocatable object files
https://github.com/yugr/symbolhider
abi shared-library visibility
Last synced: 11 days ago
JSON representation
A tool which hides symbols exported from shared libraries or relocatable object files
- Host: GitHub
- URL: https://github.com/yugr/symbolhider
- Owner: yugr
- License: mit
- Created: 2022-01-04T12:29:05.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-04-29T12:59:07.000Z (almost 2 years ago)
- Last Synced: 2025-03-25T09:52:59.281Z (28 days ago)
- Topics: abi, shared-library, visibility
- Language: C
- Homepage:
- Size: 33.2 KB
- Stars: 36
- Watchers: 4
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
[](https://github.com/yugr/SymbolHider/blob/master/LICENSE.txt)
[](https://github.com/yugr/SymbolHider/actions)
[](https://codecov.io/gh/yugr/SymbolHider)
[](https://lgtm.com/projects/g/yugr/SymbolHider/alerts/)
[](https://scan.coverity.com/projects/yugr-SymbolHider)# What's this?
SymbolHider is a simple tool which hides symbols in ELF shared library's public interface
(by rewriting their visibility to `hidden`).The tool is inspired by @EmployedRussian suggestion in [Is there any way to override the -fvisibility=hidden at link time?](https://stackoverflow.com/questions/36273404/is-there-any-way-to-override-the-fvisibility-hidden-at-link-time) although I also enabled it for a more common case of fully linked binaries.
# How to use
To hide some symbols in a library, run tool like
```
$ sym-hider libxyz.so foo bar
```To instead _unhide_ some symbols, run tool like
```
$ sym-hider --unhide file.o foo bar
```
(usually this will not work for already linked files i.e. executables and shlibs).For more details run
```
$ sym-hider -h
```# TODO
* Support 32-bit ELFs
* Support DLL and Mach-O (is it possible?)
* Hide by wildcards
* More tests
* Support static libs (?)
* Warn on missing symbols