public inbox for debugedit@sourceware.org
 help / color / mirror / Atom feed
From: "mark at klomp dot org" <sourceware-bugzilla@sourceware.org>
To: debugedit@sourceware.org
Subject: [Bug debugedit/28728] Unknown DWARF DW_FORM_0x25 (DW_FORM_strx)
Date: Mon, 11 Dec 2023 14:02:14 +0000	[thread overview]
Message-ID: <bug-28728-13298-TNO4IVJ5yj@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-28728-13298@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=28728

Mark Wielaard <mark at klomp dot org> changed:

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

--- Comment #9 from Mark Wielaard <mark at klomp dot org> ---
commit 3e7aeeab4f744ad15108775685db68d3a35b0735
Author: Mark Wielaard <mark@klomp.org>
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
    relptr.

            * 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.

    https://sourceware.org/bugzilla/show_bug.cgi?id=28728

    Signed-off-by: Mark Wielaard <mark@klomp.org>

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

  parent reply	other threads:[~2023-12-11 14:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-27  7:23 [Bug debugedit/28728] New: Unknown DWARF DW_FORM_0x25 vt at altlinux dot org
2021-12-27  7:30 ` [Bug debugedit/28728] " vt at altlinux dot org
2021-12-27 10:40 ` [Bug debugedit/28728] Unknown DWARF DW_FORM_0x25 (DW_FORM_strx) mark at klomp dot org
2022-02-18  7:41 ` telans at posteo dot de
2022-02-18  7:47 ` telans at posteo dot de
2022-11-09  6:58 ` sam at gentoo dot org
2022-11-11  5:06 ` sam at gentoo dot org
2023-09-24 18:10 ` seppo.yliolli at gmail dot com
2023-12-06 14:39 ` mark at klomp dot org
2023-12-11 14:02 ` mark at klomp dot org [this message]
2024-04-27 11:50 ` vt at altlinux dot org
2024-05-15 11:29 ` mark at klomp dot org

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=bug-28728-13298-TNO4IVJ5yj@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=debugedit@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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).