RE: How to make gcc generate optimized code for statically linked TLS

2013-07-14 Thread Pinski, Andrew
Yes don't compile with -fPIC or compile with -ftls-model=local-exec . Thanks, Andrew Pinski From: linaro-toolchain-boun...@lists.linaro.org linaro-toolchain-boun...@lists.linaro.org on behalf of Vitali Sokhin vitali.sok...@gmail.com Sent: Sunday, July 14, 2013

Re: How to make gcc generate optimized code for statically linked TLS

2013-07-14 Thread Vitali Sokhin
Thank you, with -ftls-model=local-exec gcc emits code that calculates offset at link time: threadedVar = 0xDEAD; 1125c:d53bd041 mrsx1, tpidr_el0 11260:91401020 addx0, x1, #0x4, lsl #12 11264:9105a000 addx0, x0, #0x168 11268:529bd5a2