Dwarf: fix build with old gcc
authorJan Beulich <jbeulich@suse.com>
Tue, 16 Feb 2021 10:26:00 +0000 (11:26 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 16 Feb 2021 10:26:00 +0000 (11:26 +0100)
4.3-ish warns about a possibly uninitialized variable, which results in
a build failure due to -Werror.

binutils/ChangeLog
binutils/dwarf.c

index 0edfcbe3f28e0b11b18922b08b2a1521b7d166dd..32c97b5ee90064928eb0e3698382eb2abb650af8 100644 (file)
@@ -1,3 +1,7 @@
+2021-02-16  Jan Beulich  <jbeulich@suse.com>
+
+       * dwarf.c (process_debug_info): Initialize "dwo_id".
+
 2021-02-15  Alan Modra  <amodra@gmail.com>
 
        * objdump.c (load_specific_debug_section): Don't call
index c863acfeda24f0a58e046327a6d9efe1ace13d76..a69d110665981f9b6d87613d64734421567cf80d 100644 (file)
@@ -3693,7 +3693,7 @@ process_debug_info (struct dwarf_section *           section,
        SAFE_BYTE_GET_AND_INC (compunit.cu_pointer_size, hdrptr, 1, end);
 
       bfd_boolean do_dwo_id = FALSE;
-      uint64_t dwo_id;
+      uint64_t dwo_id = 0;
       if (compunit.cu_unit_type == DW_UT_split_compile
          || compunit.cu_unit_type == DW_UT_skeleton)
        {