]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Call reloc hook with the original address, not incremented
authorPetr Machata <pmachata@redhat.com>
Fri, 22 May 2009 06:40:25 +0000 (08:40 +0200)
committerPetr Machata <pmachata@redhat.com>
Fri, 22 May 2009 06:40:25 +0000 (08:40 +0200)
libdw/libdwP.h

index 720f1dbe23dd37c38bf9e32182b47a04c850505f..9009a36f51a4551c029705e60ee391ca005575ef 100644 (file)
@@ -497,6 +497,7 @@ __libdw_in_section (Dwarf *dbg, int sec_index,
     if (!__libdw_in_section (dbg, sec_index, *addr, width))            \
       return -1;                                                       \
                                                                        \
+    unsigned char *orig_addr = *addr;                                  \
     if (width == 4)                                                    \
       VAL = read_4ubyte_unaligned_inc (dbg, *addr);                    \
     else                                                               \
@@ -505,7 +506,7 @@ __libdw_in_section (Dwarf *dbg, int sec_index,
        VAL = read_8ubyte_unaligned_inc (dbg, *addr);                   \
       }                                                                        \
                                                                        \
-    int status = RELOC_HOOK (dbg, sec_index, *addr, width, &VAL);      \
+    int status = RELOC_HOOK (dbg, sec_index, orig_addr, width, &VAL);  \
     if (status < 0)                                                    \
       return status;                                                   \
     status > 0;                                                                \