]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
libdw: Use elf_rawdata when checking .debug section
authorMark Wielaard <mark@klomp.org>
Mon, 20 Feb 2023 15:42:56 +0000 (16:42 +0100)
committerMark Wielaard <mark@klomp.org>
Thu, 23 Feb 2023 10:17:11 +0000 (11:17 +0100)
.debug sections are raw bytes and don't need conversion even when host
and file have different endian order.

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

index e0cd8f2125aa991b1055b09bf0a681a273f251d6..5e60f786d625acb3013bd0935996c504e5df47d1 100644 (file)
@@ -1,3 +1,7 @@
+2023-02-20  Mark Wielaard  <mark@klomp.org>
+
+       * dwarf_begin_elf.c (check_section): Use elf_rawdata.
+
 2023-02-14  Mark Wielaard  <mark@klomp.org>
 
        * dwarf_getlocation.c (__libdw_intern_expression): Correct check
index 1d4bb33337b73c1925d26bf6cd5480ee0b5ff757..92d76d240585e4a9ef16674fe5fbdcc7ac53b97b 100644 (file)
@@ -1,5 +1,6 @@
 /* Create descriptor from ELF descriptor for processing file.
    Copyright (C) 2002-2011, 2014, 2015, 2017, 2018 Red Hat, Inc.
+   Copyright (C) 2023, Mark J. Wielaard <mark@klomp.org>
    This file is part of elfutils.
 
    This file is free software; you can redistribute it and/or modify
@@ -242,8 +243,8 @@ check_section (Dwarf *result, size_t shstrndx, Elf_Scn *scn, bool inscngrp)
        }
     }
 
-  /* Get the section data.  */
-  Elf_Data *data = elf_getdata (scn, NULL);
+  /* Get the section data.  Should be raw bytes, no conversion needed.  */
+  Elf_Data *data = elf_rawdata (scn, NULL);
   if (data == NULL)
     goto err;