|
Bartleby 0.1.0
A symbol renaming toolkit
|
Bartleby is a library and tool designed to help developers avoid symbol name collisions across object files and static libraries.
Name collisions can occur at link time when several objects or static libraries define the same symbol names.
Based on LLVM, Bartleby aims to provide an efficient and easy-to-use solution to this problem by filtering and renaming symbols across a given set of libraries.
Example of an output from clang when pre-linking two objects together that both define the SSL_CTX_new symbol.
Bartleby can be compiled using Bazel or CMake.
objcopy is a great tool for manipulating object files and libraries. Through its --prefix-symbols options, it already offers a way to rename all the symbols defined in a target by prefixing their name.
However, this solution doesn't work well: --prefix-symbols also applies to symbols pointing to external (i.e. undefined) functions, such as the ones from the libc.