Author: kib
Date: Sat Oct 15 12:05:31 2011
New Revision: 226383
URL: http://svn.freebsd.org/changeset/base/226383

Log:
  MFC r226156:
  Handle the R_386_TLS_TPOFF32 relocation.

Modified:
  stable/8/libexec/rtld-elf/i386/reloc.c
Directory Properties:
  stable/8/libexec/rtld-elf/   (props changed)

Modified: stable/8/libexec/rtld-elf/i386/reloc.c
==============================================================================
--- stable/8/libexec/rtld-elf/i386/reloc.c      Sat Oct 15 12:02:55 2011        
(r226382)
+++ stable/8/libexec/rtld-elf/i386/reloc.c      Sat Oct 15 12:05:31 2011        
(r226383)
@@ -207,9 +207,11 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry 
                break;
 
            case R_386_TLS_TPOFF:
+           case R_386_TLS_TPOFF32:
                {
                    const Elf_Sym *def;
                    const Obj_Entry *defobj;
+                   Elf_Addr add;
 
                    def = find_symdef(ELF_R_SYM(rel->r_info), obj, &defobj,
                      false, cache);
@@ -231,8 +233,11 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry 
                            goto done;
                        }
                    }
-
-                   *where += (Elf_Addr) (def->st_value - defobj->tlsoffset);
+                   add = (Elf_Addr) (def->st_value - defobj->tlsoffset);
+                   if (ELF_R_TYPE(rel->r_info) == R_386_TLS_TPOFF)
+                       *where += add;
+                   else
+                       *where -= add;
                }
                break;
 
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to