]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
dwarflint: Forgot to commit the other_byte_order bit
authorPetr Machata <pmachata@redhat.com>
Sun, 19 Jul 2009 15:45:23 +0000 (17:45 +0200)
committerPetr Machata <pmachata@redhat.com>
Sun, 19 Jul 2009 15:45:23 +0000 (17:45 +0200)
src/dwarflint.c

index 292385517244fd2e9af409d3edec84572e9842f3..9ad978f1d45f44b853e1be0fc2ca1d5d6d1f2937 100644 (file)
@@ -1030,6 +1030,13 @@ elf_file_init (struct elf_file *file, Elf *elf)
 
   file->addr_64 = file->ehdr.e_ident[EI_CLASS] == ELFCLASS64;
 
+  /* Taken from dwarf_begin_elf.c.  */
+  if ((BYTE_ORDER == LITTLE_ENDIAN
+       && file->ehdr.e_ident[EI_DATA] == ELFDATA2MSB)
+      || (BYTE_ORDER == BIG_ENDIAN
+         && file->ehdr.e_ident[EI_DATA] == ELFDATA2LSB))
+    file->other_byte_order = true;
+
   struct secinfo
   {
     const char *name;