Build a pipeline of transformers, so that paths marked for
keeping or removing will be taken in account also when
building the graph of ELF dependencies.
Also includes a few refactorings.
This change contains three improvements:
- we use a separate root node, so that it is easier to debug
what is going on
- we now are able to print the DOT graph of ELF binaries in
DsoCleaner
- we do not eagerly resolve symlinks, which produced completely
incorrect results before
This uses the .gitignore format to identify
which files should be allowed / blocked.
The allowlist gets precedence over the blocklist
if both are specified.
This is the first implementation of a recursive
DSO cleaner which is reasonably fast.
The implementation is still (unit-) untested.
Of course, modules to be dlopen'ed will always
escape such a tool, which will need to
support another cleaner plugin with a
whitelist.