This as another early patch FYI.
The main issues with this one is the use of llvm::StringTableBuilder. It assumes a specific string format and we have to hack around it. It is also fairly slow.
With this patch the size of clang goes from 87499552 to 77160296, but the link time goes from 0.527103515 to 1.072978416.
Gold produces a binary that is 64589560 bytes long in 1.099916754 seconds.
I will try to code a more efficient StringTableBuilder and optimize offset lookups.
I dislike the name of this function. SectionType seems to indicate the SHT_* values. getSectionKind would be fine.