diff options
author | Mark Wielaard <mark@klomp.org> | 2023-02-20 16:42:56 +0100 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2023-02-23 11:17:11 +0100 |
commit | 9548a7f06e4bcfc640e8d470444c1cdbea5a6f73 (patch) | |
tree | 86f4401037a2f98b8c26f3ce28b5ace3123f6da0 /libdw/dwarf_begin_elf.c | |
parent | 924bee3c416b50bfdfdb53a3058eac1d7d859ef0 (diff) | |
download | elfutils-9548a7f06e4bcfc640e8d470444c1cdbea5a6f73.tar.gz |
libdw: Use elf_rawdata when checking .debug section
.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>
Diffstat (limited to 'libdw/dwarf_begin_elf.c')
-rw-r--r-- | libdw/dwarf_begin_elf.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libdw/dwarf_begin_elf.c b/libdw/dwarf_begin_elf.c index 1d4bb333..92d76d24 100644 --- a/libdw/dwarf_begin_elf.c +++ b/libdw/dwarf_begin_elf.c @@ -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; |