]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Fix relocation when symbols are resolved in non-ET_REL modules.
authorRoland McGrath <roland@redhat.com>
Wed, 22 Apr 2009 19:29:32 +0000 (12:29 -0700)
committerRoland McGrath <roland@redhat.com>
Wed, 22 Apr 2009 19:29:32 +0000 (12:29 -0700)
libdwfl/ChangeLog
libdwfl/relocate.c

index 86a08e9329d7b470335ffdea03122ddd0c79a6dc..f0b0a284aad33d807a0fa588a6ff126cd94a71ea 100644 (file)
@@ -1,5 +1,8 @@
 2009-04-22  Roland McGrath  <roland@redhat.com>
 
+       * relocate.c (resolve_symbol): Apply correct bias to st_value found in
+       a non-ET_REL module.
+
        * dwfl_module_build_id.c (__libdwfl_find_build_id): Fix last change to
        adjust properly for non-ET_REL.
 
index b236ca50a6effed196cbc1e77159cd74b579d9a6..2c0f301081e11c7715e2c95ff552bfd033cf3473 100644 (file)
@@ -267,9 +267,15 @@ resolve_symbol (Dwfl_Module *referer, struct reloc_symtab_cache *symtab,
                  continue;
 
                /* We found it!  */
-               if (shndx == SHN_ABS)
+               if (shndx == SHN_ABS) /* XXX maybe should apply bias? */
                  return DWFL_E_NOERROR;
 
+               if (m->e_type != ET_REL)
+                 {
+                   sym->st_value += m->symfile->bias;
+                   return DWFL_E_NOERROR;
+                 }
+
                /* In an ET_REL file, the symbol table values are relative
                   to the section, not to the module's load base.  */
                size_t symshstrndx = SHN_UNDEF;