The relocation codes for R_<CLS>_PLT32 are incorrectly in the dynamic relocation range that starts at 1024 for AArch64 and 180 for AArch64_32. Correct these codes so that they start at the next available static relocation code below TLS. The R_<CLS>_PLT32 description is currently in unpublished draft so this change corrects LLVM to match the values that will appear in the next release of ELF for the 64-bit Arm Architecture document.
Thanks for the comments. When I made the change I looked at:
Static relocation codes for ELF64 object files begin at (257); dynamic ones at (1024). Both (0) and (256) should be accepted as values of R_AARCH64_NONE, the null relocation. Static relocation codes for ELF32 object files begin at ; dynamic ones at .
I couldn't find anything about a TLS range, but it looks like there is one being observed even if it isn't explicitly called out. Let me know if you've spotted it?
I'll check with my colleagues tomorrow as I'll need to get the ABI change approved before updating here. My preference would be to move before the TLS relocations but it is probably not the end of the world as I don't think that there is any tool that could guarantee the TLS relocations were in a certain range to make a simpler isTLSReloc check.