dumpSymbolNamesFromObject is the method that dumps symbol names.
It has 563 lines, mostly because of huge piece of MachO specific code.
In this patch I move it to separate helper method.
The new size of dumpSymbolNamesFromObject is 93 lines. With it it becomes
much easier to maintain it.
I had to change the type of 2 name fields to std::string, because MachO logic
uses temporarily buffer strings (e.g ExportsNameBuffer, BindsNameBuffer etc):
std::string ExportsNameBuffer; raw_string_ostream EOS(ExportsNameBuffer);
these buffers were moved to dumpSymbolsFromDLInfoMachO by this patch and
are invalidated after return. Technically, before this patch we had a situation
when local pointers (symbol names) were assigned to members of global static SymbolList,
what is dirty by itself.
Whilst you're here, you could get rid of the unnecessary const & here, if you want.