<R_CRIS_32_DTPREL>: Correct relocation value.
2009-01-27 Hans-Peter Nilsson <hp@axis.com>
+ * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_16_DTPREL>
+ <R_CRIS_32_DTPREL>: Correct relocation value.
+
* elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_8>
<R_CRIS_16, R_CRIS_32>: Don't call BFD_ASSERT for weak undefined
symbols with non-default visibility.
}
/* The thread-based offset to the local symbol is the
- relocation. */
+ relocation.
+ For the executable, TLS data begins at the thread pointer plus
+ the negative size of the TLS data. For a DSO, that's part of
+ the module TLS offset. */
relocation -= elf_hash_table (info)->tls_sec == NULL
- ? 0 : elf_hash_table (info)->tls_sec->vma;
+ ? 0 : (elf_hash_table (info)->tls_sec->vma
+ + (info->shared
+ ? 0 : elf_hash_table (info)->tls_sec->size));
break;
case R_CRIS_32_GD: