As a poor man's direct binding feature, -Bsymbolic-functions is incompatible with two things: (1) canonical PLT entries with -fno-pic code. This should be fixed on GCC's side https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100593 (2) some vague linkage function definitions. See below cat > ./a.cc <<eof inline void f() {} void *g() { return (void *)&f; } eof cat > ./a.sh <<eof gcc -fpic -fuse-ld=bfd -shared -Wl,-Bsymbolic-functions a.cc -o a.so gcc -fpie -fuse-ld=bfd b.cc ./a.so ./a.out eof cat > ./b.cc <<eof #include <stdio.h> inline void f() {} void *g(); int main() { printf("exe: %p\n", (void *)&f); printf("DSO: %p\n", g()); } eof On Mach-O, such symbols are placed into __LINKEDIT,__weak_binding so that dyld can coalesce the definitions across dylibs. For ELF, we can introduce -Bsymbolic-global-functions to exclude STB_WEAK function definitions, avoiding the pointer equality issue. For more context, see https://maskray.me/blog/2021-05-16-elf-interposition-and-bsymbolic#the-last-alliance-of-elf-and-men
ld patch: https://sourceware.org/pipermail/binutils/2021-May/116703.html gold patch: https://sourceware.org/pipermail/binutils/2021-May/116683.html (I was considering -Bsymbolic-global-functions but Peter Smith suggested that "global" can confuse users. non-weak or non-vague is better. Detecting vague properly requires detection of COMDAT, which would cause some complexity. I feel that non-weak is better: this way we provide an escape hatch for users who want definition interposition (very rare and good to have a way))