gcc and linker tricks

Two patches which can be separated if needed.

The first allows the compiler to know which symbols are visible vs the linker so it can theoretically perform better optimizations. This probably could only make a difference in the statically linked case, but it may be worth the modest effort.

The second implements a symbol versioning scheme similar to glibc's to allow for retaining backward compatibility with existing linked binaries while only allowing newly linked applications to use the current interface (as described in the header).
Why do we need this define?