Renumber arm64 TLS to match GNU values
The AArch64 ELF specification originally specified these relocations:
R_AARCH64_TLS_DTPREL64 1028
R_AARCH64_TLS_DTPMOD64 1029
However, the GNU toolchain implemented them as:
R_AARCH64_TLS_DTPMOD64 1028
R_AARCH64_TLS_DTPREL64 1029
The AArch64 ELF specification has been updated to replace the relocations
with R_AARCH64_TLS_IMPDEF1 and with R_AARCH64_TLS_IMPDEF2, where each
implementation can choose which interpretation it implements, but with a
suggestion to follow the GNU behavior.
Also: remove the 64 suffixes from the TLS relocations. The newest version
of the AArch64 ELF specification (version f) also omits the suffixes, as
do the glibc headers.
Bug: http://b/123385182
Bug: https://bugs.llvm.org/show_bug.cgi?id=40507
Test: build device, it boots
Change-Id: Ie98b7624752982973f0ac969d646454a86784cab
diff --git a/linker/linker_relocs.h b/linker/linker_relocs.h
index 68191f9..1da5ebe 100644
--- a/linker/linker_relocs.h
+++ b/linker/linker_relocs.h
@@ -38,9 +38,9 @@
#define R_GENERIC_GLOB_DAT R_AARCH64_GLOB_DAT
#define R_GENERIC_RELATIVE R_AARCH64_RELATIVE
#define R_GENERIC_IRELATIVE R_AARCH64_IRELATIVE
-#define R_GENERIC_TLS_DTPMOD R_AARCH64_TLS_DTPMOD64
-#define R_GENERIC_TLS_DTPREL R_AARCH64_TLS_DTPREL64
-#define R_GENERIC_TLS_TPREL R_AARCH64_TLS_TPREL64
+#define R_GENERIC_TLS_DTPMOD R_AARCH64_TLS_DTPMOD
+#define R_GENERIC_TLS_DTPREL R_AARCH64_TLS_DTPREL
+#define R_GENERIC_TLS_TPREL R_AARCH64_TLS_TPREL
#define R_GENERIC_TLSDESC R_AARCH64_TLSDESC
#elif defined (__arm__)