Building on top of https://reviews.llvm.org/D27158 this adds support static linking for ARM TLS.
To do this we add support for the module index relocation R_ARM_DTPMOD32 to be resolved at static link time. The module index for the executable is always 1 so this is trivial to resolve.
The logic in handleNoRelaxTlsRelocation remains the same for Mips as it has its own custom GOT writing code. For ARM we add the module index relocation to the GOT when it can be resolved statically.
In addition to this change I noticed that the type of the RelExpr for the TlsGotRel should be R_TLS and not R_ABS as we need to include the size of the thread control block in the calculation. I wrote a comment in Phab yesterday on D27158 but it doesn't look like it got submitted, my apologies for the mixup.
Addresses the TLS part of PR30218.
Code looks fine, but it needs comments for future readers as to why we need this.