Since you mention .so files, it seems like a reasonable assumption that you are using gcc or the gcc-like compiler.
By default, all extern functions are visible in the associated object. You can hide functions (and global variables) in each case, using the hidden attribute (while preserving extern , which allows you to use them from other source files in the same library):
int __attribute__((visibility("hidden"))) foo(void) { return 10; }
Alternatively, you can change the default value to hidden by passing the -fvisibility=hidden parameter to gcc at compile time. Then you can mark certain functions for export using:
__attribute__((visibility("default")))
source share