From 1c4afd13501f07a673aed5f130166f2ee0f30927 Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Tue, 29 Oct 2013 22:10:02 +0800 Subject: Add support for thread-local storage variables --- libtcc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libtcc.c') diff --git a/libtcc.c b/libtcc.c index f841eb0..fbea50b 100644 --- a/libtcc.c +++ b/libtcc.c @@ -444,7 +444,10 @@ ST_FUNC void put_extern_sym2(Sym *sym, Section *section, } else if ((sym->type.t & VT_BTYPE) == VT_VOID) { sym_type = STT_NOTYPE; } else { - sym_type = STT_OBJECT; + if (section && section->sh_flags & SHF_TLS) + sym_type = STT_TLS; + else + sym_type = STT_OBJECT; } if (sym->type.t & VT_STATIC) -- cgit v1.3.1