[ARM] TLS Descriptor support

Richard Earnshaw rearnsha@arm.com
Mon Jun 6 16:27:00 GMT 2011

On 05/10/11 07:49, Nathan Sidwell wrote:
> This patch implements TLS descriptor support in GCC.  TLS descriptors 
> are described at 
> http://www.codesourcery.com/publications/RFC-TLSDESC-ARM.txt and 
> blessed by ARM, who have reserved the relocation numbers.
> Binutils and GLIBC patches are already committed (there is an 
> orthogonal glibc patch to do with make dependencies that I need to 
> post though).
> This patch adds a --with-tls={arm|gnu} configuration option, to 
> specify the default scheme.  It can be overridden with a 
> -mtls-dialect={arm|gnu} option (this is the name used by the x86 
> backend, which also has tlsdescriptor support).  I have not added 
> --with-tls support to the x86 bits of config.gcc etc, but it would be 
> simple to do so.
> The arm.{c,h,md} changes are fairly mechanical -- a new tls pattern 
> and smarts to emit it appropriately.
> This patch has been tested for both default arm and default gnu tls 
> schemes using the gcc and glibc testsuites for an arm-linux-gnueabi 
> target.
> ok?
> nathan
+    /* The + is to avoid an assembly parse ambiguity with symbols that
+       look like register names, which is unsuccessfully recovered 
from.  */
+    return TARGET_THUMB2 ? "blx\\t%c0(tlscall)" : "bl\\t+%c0(tlscall)";

Eh?  This is backwards.  There is blx <reg>, but no bl <reg>.  If the 
assembler gets confused with 'bl r0' then it needs to be fixed urgently.

Further, both the assembler and the linker know how to change bl to blx 
when needed, so it's best to just put out bl and be done with it.


More information about the Gcc-patches mailing list