[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/6443] -pie issues with TLS relocations

From: amodra at bigpond dot net dot au
Subject: [Bug ld/6443] -pie issues with TLS relocations
Date: 22 Apr 2008 16:10:46 -0000

------- Additional Comments From amodra at bigpond dot net dot au  2008-04-22 
16:10 -------
I'll take a look at ppc.  The obvious change doesn't help much as enabling
ppc_elf_tls_optimize for pie results in us hitting the bfd_error_bad_value at
elf32-ppc.c:6577 when we try to make a dynamic reloc for the edited LD->LE tls
reloc.  That is, if you use an old enough compiler.

gcc 4.2 and later reschedule the tls sequences and ppc_elf_tls_optimize gives
up.  We really need some way of tying together relocs on arg setup for
__tls_get_addr and the call to __tls_get_addr itself.  One way that occurred to
me is to emit a call to the tls variable involved instead of __tls_get_addr, and
of course restore the real call in the linker.  eg. instead of

  addi 3,30,address@hidden@tlsld
  bl __tls_get_addr


  addi 3,30,address@hidden@tlsld
  bl foo

This would allow the linker to edit the sequence as the tls symbol foo on both
relocs ties things together.  A real call to a tls symbol can't happen, so all
bl some_tls_symbol means bl __tls_get_addr.  Unfortunately this is an ABI 

Alternatively, disable scheduling of tls sequences involving __tls_get_addr in 



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]