]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gas/config/tc-ppc.c
PowerPC __tls_get_addr arg parsing
authorAlan Modra <amodra@gmail.com>
Thu, 21 Feb 2019 07:11:47 +0000 (17:41 +1030)
committerAlan Modra <amodra@gmail.com>
Thu, 21 Feb 2019 07:35:05 +0000 (18:05 +1030)
commit160eba9301df423116377113f2d4189d785c7dde
tree4d7ea53d3c4c1622c7b8caeec879c639690c7a1d
parent56b80d4c4c24c6acacad15530a3a7b483b6e0f3f
PowerPC __tls_get_addr arg parsing

The syntax we ended up with for -m32 -fPIC calls to __tls_get_addr is
rather weird.
    bl __tls_get_addr+0x8000(gd0@tlsgd)@plt
This came about by accident, probably due to requiring the arg reloc
before the call reloc.

Of course the @plt really belongs with __tls_get_addr since it affects
the call rather than the call arg, and it isn't a great deal of
trouble to ensure the relocs are emitted in the correct order.  This
patch supports a newer syntax, like so:
    bl __tls_get_addr+0x8000@plt(gd0@tlsgd)

gas/
* config/tc-ppc.c (parse_tls_arg): New function, extracted..
(md_assembler): ..from here.  Call it after parsing other
suffix modifiers too.
ld/
* testsuite/ld-powerpc/tls32.s: Test new @plt syntax.
gas/config/tc-ppc.c
ld/testsuite/ld-powerpc/tls32.s