* elf32-i386.c (elf_i386_relocate_section): Fill in proper addend
authorJakub Jelinek <jakub@redhat.com>
Thu, 8 Aug 2002 21:38:27 +0000 (21:38 +0000)
committerJakub Jelinek <jakub@redhat.com>
Thu, 8 Aug 2002 21:38:27 +0000 (21:38 +0000)
for R_386_TLS_TPOFF32 relocs against symndx 0.

bfd/ChangeLog
bfd/elf32-i386.c

index 40a824e683e1e9145b4856686328764c2c8f6292..f597f9cc3116a4bec49184d744f9292441ce28bc 100644 (file)
@@ -1,3 +1,8 @@
+2002-08-08  Jakub Jelinek  <jakub@redhat.com>
+
+       * elf32-i386.c (elf_i386_relocate_section): Fill in proper addend
+       for R_386_TLS_TPOFF32 relocs against symndx 0.
+
 2002-08-07  H.J. Lu <hjl@gnu.org>
 
        * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Check symbol
index 997bf3722703ddcc3e19e789f942963542a7154b..5c0d5a1ceab7cf67c0999549ae6f8e441f152842 100644 (file)
@@ -2567,13 +2567,17 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
              outrel.r_offset = (htab->sgot->output_section->vma
                                 + htab->sgot->output_offset + off);
 
-             bfd_put_32 (output_bfd, 0,
-                         htab->sgot->contents + off);
              indx = h && h->dynindx != -1 ? h->dynindx : 0;
              if (r_type == R_386_TLS_GD)
                dr_type = R_386_TLS_DTPMOD32;
              else
                dr_type = R_386_TLS_TPOFF32;
+             if (dr_type == R_386_TLS_TPOFF32 && indx == 0)
+               bfd_put_32 (output_bfd, relocation - dtpoff_base (info),
+                           htab->sgot->contents + off);
+             else
+               bfd_put_32 (output_bfd, 0,
+                           htab->sgot->contents + off);
              outrel.r_info = ELF32_R_INFO (indx, dr_type);
              loc = (Elf32_External_Rel *) htab->srelgot->contents;
              loc += htab->srelgot->reloc_count++;