yugr / SymbolHider

A tool which hides symbols exported from shared libraries or relocatable object files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

License Build Status codecov Total alerts Coverity Scan

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? 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

About

A tool which hides symbols exported from shared libraries or relocatable object files

License:MIT License


Languages

Language:C 62.4%Language:Shell 23.3%Language:Makefile 14.3%