public inbox for
 help / color / mirror / Atom feed
From: "mark at klomp dot org" <>
Subject: [Bug debugedit/27636] Debugedit doesn't handle compressed debug ELF sections
Date: Mon, 11 Dec 2023 13:59:22 +0000	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

Mark Wielaard <mark at klomp dot org> changed:

           What    |Removed                     |Added
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #2 from Mark Wielaard <mark at klomp dot org> ---
commit 3e7aeeab4f744ad15108775685db68d3a35b0735
Author: Mark Wielaard <>
Date:   Thu Mar 23 18:07:40 2023 +0100

    debugedit: Add support for .debug_str_offsets (DW_FORM_strx)

    In theory supporting strx .debug_str_offsets is easy, the strings in
    .debug_str are just read through an indirection table. When the
    strings are updated in .debug_str we just need to rewrite the
    indirection table.

    The tricky part is the ET_REL (object files or kernel modules)
    support. Relocation reading is "global" per section and we expect to
    read a relocation only once. But we need to read the
    DW_AT_str_offsets_base before reading any strx form attributes. So we
    read that first, then reset the relptr. And when we read from the
    .debug_str_offsets section we need to save and restore the .debug_info

            * tools/debugedit.c (do_read_24): New function.
            (str_offsets_base): New static variable.
            (buf_read_ule24): New function.
            (buf_read_ube24): Likewise.
            (setup_relbuf): Handle .debug_str_offsets.
            (do_read_uleb128): New function.
            (do_read_str_form_relocated): Likewise.
            (read_abbrev): Handle DW_FORM_strx[1234].
            (edit_strp): Take the actual string form as argument.
            Use do_read_str_form_relocated.
            (read_dwarf5_line_entries): Pass form to edit_strp.
            (edit_attributes_str_comp_dir): Take the actual string
            form as argument. Use do_read_str_form_relocated.
            (edit_attributes): Handle DW_FORM_strx[1234].
            (edit_info): Read DW_AT_str_offsets_base first.
            (update_str_offsets): New function.
            (edit_dwarf2): Setup do_read_24. Call update_str_offsets.

    Signed-off-by: Mark Wielaard <>

You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2023-12-11 13:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-23 14:19 [Bug debugedit/27636] New: " mark at klomp dot org
2023-12-05 14:14 ` [Bug debugedit/27636] " mark at klomp dot org
2023-12-11 13:59 ` mark at klomp dot org [this message]
2023-12-11 14:01 ` mark at klomp dot org
2024-06-27  7:56 ` at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).