[SH] TLS IE -> LE optimization issue

Alan Modra amodra@gmail.com
Sun Apr 15 22:18:00 GMT 2012

On Fri, Apr 13, 2012 at 05:48:06PM +0200, Thomas Schwinge wrote:
> That is, we need a __thread variable that is referenced from another
> compilation unit; these two are linked into an executable; and we need a
> (dummy) SO in order to trigger creation of the .dynamic section, etc.

A dummy .so should make no difference to dynamic relocations, so
you've found a bug in the SH allocate_dynrelocs.

elf32-ppc.c allocate_dynrelocs handles this situation by testing
whether the tls symbol is defined in a dynamic library.  If not, no
dynamic relocation is allocated and a special GOT entry for local
dynamic TLS syms is used, tlsld_got.

Alan Modra
Australia Development Lab, IBM

More information about the Binutils mailing list