Flag thread local symbols in symbol table

Set STT_TLS in symbol table for symbols declared
in thread local storage sections. Note that,
for now at least, such symbols must also be
declared as GLOBAL.
This commit is contained in:
Charles Crayne 2008-10-25 19:31:09 -07:00
parent 4adf21c08c
commit efb515b98e

View File

@ -772,6 +772,14 @@ static void elf_deflabel(char *name, int32_t segment, int64_t offset,
}
special_used = true;
}
/*
* If TLS segment, mark symbol accordingly.
*/
if (sects[sym->section - 1]->flags & SHF_TLS) {
error(ERR_DEBUG, "marked %s as TLS",name);
sym->type &= 0xf0;
sym->type |= STT_TLS;
}
}
sym->globnum = nglobs;
nglobs++;