about summary refs log tree commit diff
path: root/arch/mips/reloc.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/reloc.h')
-rw-r--r--arch/mips/reloc.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/mips/reloc.h b/arch/mips/reloc.h
index 785489ed..f5e9c77b 100644
--- a/arch/mips/reloc.h
+++ b/arch/mips/reloc.h
@@ -23,6 +23,17 @@ static inline void do_single_reloc(
 	case R_MIPS_COPY:
 		memcpy(reloc_addr, (void *)sym_val, sym_size);
 		break;
+	case R_MIPS_TLS_DTPMOD32:
+		*reloc_addr = def.dso ? def.dso->tls_id : self->tls_id;
+		break;
+	case R_MIPS_TLS_DTPREL32:
+		*reloc_addr += def.sym->st_value;
+		break;
+	case R_MIPS_TLS_TPREL32:
+		*reloc_addr += def.sym
+			? def.sym->st_value + def.dso->tls_offset - 0x7000
+			: self->tls_offset - 0x7000;
+		break;
 	}
 }