tests: Fix cfi_debug_bias assert in varlocs.
authorMark Wielaard <mark@klomp.org>
Fri, 8 Jun 2018 13:07:16 +0000 (15:07 +0200)
committerMark Wielaard <mark@klomp.org>
Sun, 10 Jun 2018 15:02:22 +0000 (17:02 +0200)
It is only a consistency issue if we actually have an cfi_debug and the
cfi_debug_bias is not zero (because they come from the same file as the
other debug data).

Signed-off-by: Mark Wielaard <mark@klomp.org>
tests/ChangeLog
tests/varlocs.c

index a2adfee..25ed41e 100644 (file)
@@ -1,3 +1,8 @@
+2018-06-08  Mark Wielaard  <mark@klomp.org>
+
+       * varlocs.c (main): Only assert when cfi_debug_bias != 0 if there
+       actually is a cfi_debug.
+
 2018-06-07  Mark Wielaard  <mark@klomp.org>
 
        * run-readelf-loc.sh: Fix expected output for startx_length.
index 2ddd3d8..99c3887 100644 (file)
@@ -1121,7 +1121,8 @@ main (int argc, char *argv[])
          cfi_debug = dwfl_module_dwarf_cfi (mod, &cfi_debug_bias);
          cfi_eh = dwfl_module_eh_cfi (mod, &cfi_eh_bias);
 
-         assert (cfi_debug_bias == 0); // No bias needed, same file.
+         // No bias needed, same file.
+         assert (cfi_debug == NULL || cfi_debug_bias == 0);
 
          // We are a bit forgiving for object files.  There might be
          // relocations we don't handle that are needed in some