We already do this for shstrtab, so might as well do it for strtab. This extracts the code for this into a separate class. It might be overkill to have this in a separate file, but I figured maybe this is useful for other object formats and lld. If not, we can just move it into ELFObjectWriter.cpp.
I mostly wanted to do this for the general principle, but it does save a little bit on object file size. I tried this on a clang bootstrap and saved 0.54% on the sum of object file sizes (1.14 MB out of 212 MB for a release build).
Please add a class comment indicating that this is primarily a convenience for doing suffix deduplication.