summaryrefslogtreecommitdiff
path: root/bfd/elf32-cris.c
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2009-01-27 07:06:36 +0000
committerHans-Peter Nilsson <hp@axis.com>2009-01-27 07:06:36 +0000
commit64ee54bb587f2a23cc5b2be90b411f088b49f60f (patch)
treebe32746cb8a4af99845f1cd82d36a131cbe7562b /bfd/elf32-cris.c
parenta238a57b7103a2e9bedcc0c3dc15304f1d1c2ca0 (diff)
downloadbinutils-redhat-64ee54bb587f2a23cc5b2be90b411f088b49f60f.tar.gz
* elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_16_DTPREL>
<R_CRIS_32_DTPREL>: Correct relocation value.
Diffstat (limited to 'bfd/elf32-cris.c')
-rw-r--r--bfd/elf32-cris.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c
index 6b71ee47b9..16b0b453d1 100644
--- a/bfd/elf32-cris.c
+++ b/bfd/elf32-cris.c
@@ -1687,9 +1687,14 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
}
/* 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: