]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Fix auxv scanning in core-file grokking.
authorRoland McGrath <roland@redhat.com>
Tue, 6 Apr 2010 07:04:49 +0000 (00:04 -0700)
committerRoland McGrath <roland@redhat.com>
Tue, 6 Apr 2010 07:04:49 +0000 (00:04 -0700)
libdwfl/ChangeLog
libdwfl/link_map.c

index 86cc6930503d40b440e11f7004b0ff2d159ff998..5205bdc9a5a34c75efef099c75d29537985829d3 100644 (file)
@@ -1,3 +1,8 @@
+2010-03-11  Roland McGrath  <roland@redhat.com>
+
+       * link_map.c (auxv_format_probe): Fix scanning loop, so we really scan
+       the second half for 32-bit matches.
+
 2010-03-10  Roland McGrath  <roland@redhat.com>
 
        * core-file.c (dwfl_core_file_report): Punt EHDR argument.
index ecb4990586f169f98cf41334616464d53853fb54..5991a1128683147a2a02557eb5226eb07c1c01b7 100644 (file)
@@ -1,5 +1,5 @@
 /* Report modules by examining dynamic linker data structures.
-   Copyright (C) 2008, 2009 Red Hat, Inc.
+   Copyright (C) 2008-2010 Red Hat, Inc.
    This file is part of Red Hat elfutils.
 
    Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -123,8 +123,7 @@ auxv_format_probe (const void *auxv, size_t size,
     return false;
   }
 
-  size_t i;
-  for (i = 0; i < size / sizeof (Elf64_auxv_t); ++i)
+  for (size_t i = 0; i < size / sizeof (Elf64_auxv_t); ++i)
     {
       if (check64 (i))
        {
@@ -132,18 +131,12 @@ auxv_format_probe (const void *auxv, size_t size,
          return true;
        }
 
-      if (check32 (i))
+      if (check32 (i * 2) || check32 (i * 2 + 1))
        {
          *elfclass = ELFCLASS32;
          return true;
        }
     }
-  for (; i < size / sizeof (Elf64_auxv_t); ++i)
-    if (check32 (i))
-      {
-       *elfclass = ELFCLASS32;
-       return true;
-      }
 
   return false;
 }