From: Keith W. <ke...@tu...> - 2002-05-22 09:40:11
|
> > __thread doesn't require -fpic. There are 4 different TLS models (on IA-32): > -ftls-model=global-dynamic > -ftls-model=local-dynamic > -ftls-model=initial-exec > -ftls-model=local-exec > > Neither of these require -fpic, though the first 3 use pic > register (if not -fpic, they just load it into some arbitrary register). > The GD model is for dlopenable libraries referencing __thread variables > that can be anywhere (and is most expensive, a function call), LD is for > dlopenable libraries referencing __thread variables within that library > (again, a function call, but can be one per whole function for all __thread > vars mentioned in it), IE is for libraries/programs which cannot be dlopened > and can reference __thread variables anywhere in the startup program > or its dependencies and LE is for programs only, referencing > __thread variables in it. IE involves a memory load from GOT and subtracts > that value from %gs:0, LE results in immediate being added to %gs:0. It doesn't sound like there's anything in there for us that's a real improvement: Both of the 'dlopenable' varients require a function call? That's a huge overhead for the application we're talking about. Keith |