From 2ccb2f04e03e5b2ee88a4404a68dcd08f414688e Mon Sep 17 00:00:00 2001 From: Ryan Prichard Date: Tue, 1 Jan 2019 01:49:41 -0800 Subject: [PATCH] Add generic TLS linker reloc macros Bug: http://b/78026329 Test: build bionic Change-Id: I7f9d3a250f27c31d0b8d9a3a306468fdf723f9c8 --- linker/linker_relocs.h | 48 ++++++++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/linker/linker_relocs.h b/linker/linker_relocs.h index 4bab0e0a5..68191f911 100644 --- a/linker/linker_relocs.h +++ b/linker/linker_relocs.h @@ -34,30 +34,46 @@ #if defined (__aarch64__) -#define R_GENERIC_JUMP_SLOT R_AARCH64_JUMP_SLOT -#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_JUMP_SLOT R_AARCH64_JUMP_SLOT +#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_TLSDESC R_AARCH64_TLSDESC #elif defined (__arm__) -#define R_GENERIC_JUMP_SLOT R_ARM_JUMP_SLOT -#define R_GENERIC_GLOB_DAT R_ARM_GLOB_DAT -#define R_GENERIC_RELATIVE R_ARM_RELATIVE -#define R_GENERIC_IRELATIVE R_ARM_IRELATIVE +#define R_GENERIC_JUMP_SLOT R_ARM_JUMP_SLOT +#define R_GENERIC_GLOB_DAT R_ARM_GLOB_DAT +#define R_GENERIC_RELATIVE R_ARM_RELATIVE +#define R_GENERIC_IRELATIVE R_ARM_IRELATIVE +#define R_GENERIC_TLS_DTPMOD R_ARM_TLS_DTPMOD32 +#define R_GENERIC_TLS_DTPREL R_ARM_TLS_DTPOFF32 +#define R_GENERIC_TLS_TPREL R_ARM_TLS_TPOFF32 +#define R_GENERIC_TLSDESC R_ARM_TLS_DESC #elif defined (__i386__) -#define R_GENERIC_JUMP_SLOT R_386_JMP_SLOT -#define R_GENERIC_GLOB_DAT R_386_GLOB_DAT -#define R_GENERIC_RELATIVE R_386_RELATIVE -#define R_GENERIC_IRELATIVE R_386_IRELATIVE +#define R_GENERIC_JUMP_SLOT R_386_JMP_SLOT +#define R_GENERIC_GLOB_DAT R_386_GLOB_DAT +#define R_GENERIC_RELATIVE R_386_RELATIVE +#define R_GENERIC_IRELATIVE R_386_IRELATIVE +#define R_GENERIC_TLS_DTPMOD R_386_TLS_DTPMOD32 +#define R_GENERIC_TLS_DTPREL R_386_TLS_DTPOFF32 +#define R_GENERIC_TLS_TPREL R_386_TLS_TPOFF +#define R_GENERIC_TLSDESC R_386_TLS_DESC #elif defined (__x86_64__) -#define R_GENERIC_JUMP_SLOT R_X86_64_JUMP_SLOT -#define R_GENERIC_GLOB_DAT R_X86_64_GLOB_DAT -#define R_GENERIC_RELATIVE R_X86_64_RELATIVE -#define R_GENERIC_IRELATIVE R_X86_64_IRELATIVE +#define R_GENERIC_JUMP_SLOT R_X86_64_JUMP_SLOT +#define R_GENERIC_GLOB_DAT R_X86_64_GLOB_DAT +#define R_GENERIC_RELATIVE R_X86_64_RELATIVE +#define R_GENERIC_IRELATIVE R_X86_64_IRELATIVE +#define R_GENERIC_TLS_DTPMOD R_X86_64_DTPMOD64 +#define R_GENERIC_TLS_DTPREL R_X86_64_DTPOFF64 +#define R_GENERIC_TLS_TPREL R_X86_64_TPOFF64 +#define R_GENERIC_TLSDESC R_X86_64_TLSDESC #endif