Add support for substitions when mangling names

When an encoded name is reused in a mangled name, it is replaced with
a substitution of the form S<id>_ where id is the position of where the
encoded name appears already. S_ is used to refer to the 0th index,
S0_ the first and so on. For example:

Foo::Foo would be encoded as _ZN3FooS_E
(whereby S_ is used for the second Foo)

When we mangle C++ names to find the vtable global var, SOAAP now
performs this compression as per the C++ ABI (thanks to David for the
link!): http://mentorembedded.github.io/cxx-abi/abi.html