+static
+Elf64_Half get_type(Elf* elf)
+{
+ Elf64_Ehdr* ehdr64 = elf64_getehdr(elf);
+ if (ehdr64)
+ return ehdr64->e_type;
+ Elf32_Ehdr* ehdr32 = elf32_getehdr(elf);
+ if (ehdr32)
+ return ehdr32->e_type;
+ xbt_die("Could not get ELF heeader");
+}
+
+static
+void read_dwarf_info(simgrid::mc::ObjectInformation* info, Dwarf* dwarf)
+{
+ // For each compilation unit:
+ Dwarf_Off offset = 0;
+ Dwarf_Off next_offset = 0;
+ size_t length;
+
+ while (dwarf_nextcu(dwarf, offset, &next_offset, &length, nullptr, NULL, NULL) ==
+ 0) {
+ Dwarf_Die unit_die;
+ if (dwarf_offdie(dwarf, offset + length, &unit_die) != nullptr)
+ MC_dwarf_handle_children(info, &unit_die, &unit_die, nullptr, NULL);
+ offset = next_offset;
+ }
+}
+