]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
libdwfl/
authorJan Kratochvil <jan.kratochvil@redhat.com>
Wed, 17 Oct 2012 19:49:10 +0000 (21:49 +0200)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Wed, 17 Oct 2012 19:49:10 +0000 (21:49 +0200)
2012-10-17  Jan Kratochvil  <jan.kratochvil@redhat.com>

* dwfl_module_getdwarf.c (__libdwfl_getelf): Do not return yet on
matching build-id.  Check ELFERR before closing this MOD file.

tests/
2012-10-17  Jan Kratochvil  <jan.kratochvil@redhat.com>

* run-addrname-test.sh: New test for DSO with build-id bias.
* testfile69.core.bz2: New file.
* testfile69.so.bz2: New file.

Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
libdwfl/ChangeLog
libdwfl/dwfl_module_getdwarf.c
tests/ChangeLog
tests/run-addrname-test.sh
tests/testfile69.core.bz2 [new file with mode: 0644]
tests/testfile69.so.bz2 [new file with mode: 0755]

index 189d3b717227ba3af821c46866c5fb9d6cf45205..db3c9b7beb96790d8b5ac0f6091d49acddc93e34 100644 (file)
@@ -1,3 +1,8 @@
+2012-10-17  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * dwfl_module_getdwarf.c (__libdwfl_getelf): Do not return yet on
+       matching build-id.  Check ELFERR before closing this MOD file.
+
 2012-10-10  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        * dwfl_segment_report_module.c (dwfl_segment_report_module):
index bbf9ff3d8b42b4c407a403a9995d911900e9595d..fe0755b9899c26c658700480b3e9cf6f5406d677 100644 (file)
@@ -176,8 +176,8 @@ __libdwfl_getelf (Dwfl_Module *mod)
                                                         mod->main.elf), 2))
        {
        case 2:
-         /* Build ID matches as it should. */
-         return;
+         /* Build ID matches as it should.  But initialize MAIN_BIAS below.  */
+         break;
 
        case -1:                        /* ELF error.  */
          mod->elferr = INTUSE(dwfl_errno) ();
@@ -192,13 +192,16 @@ __libdwfl_getelf (Dwfl_Module *mod)
          abort ();
        }
 
-      /* We get here when it was the right ELF file.  Clear it out.  */
-      elf_end (mod->main.elf);
-      mod->main.elf = NULL;
-      if (mod->main.fd >= 0)
+      if (mod->elferr != DWFL_E_NOERROR)
        {
-         close (mod->main.fd);
-         mod->main.fd = -1;
+         /* We get here when it was the right ELF file.  Clear it out.  */
+         elf_end (mod->main.elf);
+         mod->main.elf = NULL;
+         if (mod->main.fd >= 0)
+           {
+             close (mod->main.fd);
+             mod->main.fd = -1;
+           }
        }
     }
 
index 2495fb58ce9af4421319dec8e1871a5705b0a6b5..9e8ad2c15e417deff947251a1048cb9fd39951d5 100644 (file)
@@ -1,3 +1,9 @@
+2012-10-17  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * run-addrname-test.sh: New test for DSO with build-id bias.
+       * testfile69.core.bz2: New file.
+       * testfile69.so.bz2: New file.
+
 2012-10-10  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        * run-addrname-test.sh: New test for core vDSO bias.
index 4feb193658a1f071827a1451e39bc2a604ba658d..cc8aa335ac2c3ece0201ecbee43180399430be3a 100755 (executable)
@@ -298,4 +298,12 @@ __vdso_time
 ??:0
 EOF
 
+testfiles testfile69.core testfile69.so
+testrun_compare ../src/addr2line --core=./testfile69.core -S 0x7f0bc6a33535 0x7f0bc6a33546 <<\EOF
+libstatic+0x9
+??:0
+libglobal+0x9
+??:0
+EOF
+
 exit 0
diff --git a/tests/testfile69.core.bz2 b/tests/testfile69.core.bz2
new file mode 100644 (file)
index 0000000..9955318
Binary files /dev/null and b/tests/testfile69.core.bz2 differ
diff --git a/tests/testfile69.so.bz2 b/tests/testfile69.so.bz2
new file mode 100755 (executable)
index 0000000..fdddab9
Binary files /dev/null and b/tests/testfile69.so.bz2 differ