Any global scope variable with
default visibility should be exported when a shared object is built. If you build with
hidden visibility as a global setting, which you should do, then use
__attribute__((visibility("default"))) to mark the symbol as having exported visibility. You may also be interesting in reading
How To Write Shared Libraries by Ulrich Drepper.