aboutsummaryrefslogtreecommitdiff
path: root/tccgen.c
diff options
context:
space:
mode:
authorThomas Preud'homme <robotux@celest.fr>2013-11-03 18:55:54 +0800
committerThomas Preud'homme <robotux@celest.fr>2013-11-03 18:55:54 +0800
commitcf02f920c148a77794b05ba09d73586e5f0b3601 (patch)
treed35e02afb9539566893e4e09cee83c9a4886ac2b /tccgen.c
parent1c4afd13501f07a673aed5f130166f2ee0f30927 (diff)
downloadtinycc-cf02f920c148a77794b05ba09d73586e5f0b3601.tar.gz
tinycc-cf02f920c148a77794b05ba09d73586e5f0b3601.tar.bz2
Revert "Add support for thread-local storage variables"
TLS support in tinyCC is absolutely not ready: - segment register not select in load and store - no relocation added for computing offset of per-thread symbol - no support for TLS-specific relocations - no program header added as per Drepper document about TLS This reverts commit 1c4afd13501f07a673aed5f130166f2ee0f30927.
Diffstat (limited to 'tccgen.c')
-rw-r--r--tccgen.c29
1 files changed, 4 insertions, 25 deletions
diff --git a/tccgen.c b/tccgen.c
index bfe461f..bab4f7c 100644
--- a/tccgen.c
+++ b/tccgen.c
@@ -31,7 +31,6 @@
ST_DATA int rsym, anon_sym, ind, loc;
ST_DATA Section *text_section, *data_section, *bss_section; /* predefined sections */
-ST_DATA Section *tdata_section, *tbss_section; /* thread-local storage sections */
ST_DATA Section *cur_text_section; /* current section where function code is generated */
#ifdef CONFIG_TCC_ASM
ST_DATA Section *last_text_section; /* to handle .previous asm directive */
@@ -3093,10 +3092,6 @@ static int parse_btype(CType *type, AttributeDef *ad)
t |= VT_INLINE;
next();
break;
- case TOK_THREAD:
- t |= VT_TLS;
- next();
- break;
/* GNUC attribute */
case TOK_ATTRIBUTE1:
@@ -5500,26 +5495,10 @@ static void decl_initializer_alloc(CType *type, AttributeDef *ad, int r,
/* allocate symbol in corresponding section */
sec = ad->section;
if (!sec) {
- if (has_init) {
- if (type->t & VT_TLS) {
- if (!tdata_section)
- tdata_section = new_section(tcc_state, ".tdata",
- SHT_PROGBITS,
- SHF_ALLOC | SHF_WRITE | SHF_TLS);
- sec = tdata_section;
- } else
- sec = data_section;
- }
- else if (tcc_state->nocommon) {
- if (type->t & VT_TLS) {
- if (!tbss_section)
- tbss_section = new_section(tcc_state, ".tbss",
- SHT_NOBITS,
- SHF_ALLOC | SHF_WRITE | SHF_TLS);
- sec = tbss_section;
- } else
- sec = bss_section;
- }
+ if (has_init)
+ sec = data_section;
+ else if (tcc_state->nocommon)
+ sec = bss_section;
}
if (sec) {
data_offset = sec->data_offset;