dwarf-reader: read_corpus_from_elf: unconditionally load elf properties
authorMatthias Maennich <maennich@google.com>
Fri, 4 Oct 2019 15:27:07 +0000 (16:27 +0100)
committerDodji Seketeli <dodji@redhat.com>
Mon, 7 Oct 2019 09:05:38 +0000 (11:05 +0200)
When loading the corpus from elf while specifying a whitelist, we might
be able to ignore the symbol table. In any case we have to load the elf
properties into the context, such as the binary's architecture.
Otherwise they are missing from the internal / xml representation.
Previously, elf properties were not loaded when a whitelist was
specified. Fix that.

* src/abg-dwarf-reader.cc (read_corpus_from_elf):
unconditionally load elf properties into context

Signed-off-by: Matthias Maennich <maennich@google.com>
src/abg-dwarf-reader.cc

index af212ac..f2ebede 100644 (file)
@@ -18255,9 +18255,10 @@ read_corpus_from_elf(read_context& ctxt, status& status)
       status |= STATUS_ALT_DEBUG_INFO_NOT_FOUND;
   }
 
+  ctxt.load_elf_properties();  // DT_SONAME, DT_NEEDED, architecture
+
   if (!get_ignore_symbol_table(ctxt))
     {
-      ctxt.load_elf_properties();
       // Read the symbols for publicly defined decls
       if (!ctxt.load_symbol_maps())
        status |= STATUS_NO_SYMBOLS_FOUND;