]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_16_DTPREL>
authorHans-Peter Nilsson <hp@axis.com>
Tue, 27 Jan 2009 07:06:36 +0000 (07:06 +0000)
committerHans-Peter Nilsson <hp@axis.com>
Tue, 27 Jan 2009 07:06:36 +0000 (07:06 +0000)
<R_CRIS_32_DTPREL>: Correct relocation value.

bfd/ChangeLog
bfd/elf32-cris.c

index 99618693fd9ffe5d81ae192d0dc3c3657aa161f8..41cee38341b48a5d7c77e35d323fc95589ffef0b 100644 (file)
@@ -1,5 +1,8 @@
 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.
index 6b71ee47b9c556faeb7cac89a49e11b410788fe6..16b0b453d16637cf2c75c324fa99db52d5e1a92c 100644 (file)
@@ -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: