aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-i386.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2002-08-08 21:38:27 +0000
committerJakub Jelinek <jakub@redhat.com>2002-08-08 21:38:27 +0000
commitc366c25e10407f3fe6bc2fc73927fe993ee979e8 (patch)
tree5eaf8c4df70e854bf69396e4af127a3bda01b8c2 /bfd/elf32-i386.c
parentb2dd631140b8d3ada533b546dbeaed2ab3825e82 (diff)
downloadfsf-binutils-gdb-c366c25e10407f3fe6bc2fc73927fe993ee979e8.zip
fsf-binutils-gdb-c366c25e10407f3fe6bc2fc73927fe993ee979e8.tar.gz
fsf-binutils-gdb-c366c25e10407f3fe6bc2fc73927fe993ee979e8.tar.bz2
* elf32-i386.c (elf_i386_relocate_section): Fill in proper addend
for R_386_TLS_TPOFF32 relocs against symndx 0.
Diffstat (limited to 'bfd/elf32-i386.c')
-rw-r--r--bfd/elf32-i386.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 997bf37..5c0d5a1 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -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++;