From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D6A0C3858C60; Sun, 3 Mar 2024 12:35:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D6A0C3858C60 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1709469352; bh=NLkCB7ZRNAko8RbgUwOsUr07H4U0mFyuDqCLfZcDWP0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=l28ITnH/IJZCZsvmqRYQYv4+kMXux+Ksfdl7wTMsnw31xInMSjV1Pmov4waRAgWSr XXKD8caaYIGK1g0DJa5uzOeZOPU+ZOtxWQkRRZ2Eg7OMP7qG+VyNH24gjK+6nUSEs5 uPLiObR7d7m+IA8+eapW+iway/PUuFndEH4WLW+k= From: "mark at klomp dot org" To: elfutils-devel@sourceware.org Subject: [Bug libdw/31447] Provide a public debug section relocation function Date: Sun, 03 Mar 2024 12:35:52 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: elfutils X-Bugzilla-Component: libdw X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mark at klomp dot org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31447 --- Comment #1 from Mark Wielaard --- This is the current "workaround" I use when working with individual ET_REL DWARF files (also works for any other ELF type): static char *debuginfo_path =3D NULL; static const Dwfl_Callbacks dwfl_callbacks =3D { .find_elf =3D dwfl_build_id_find_elf, .find_debuginfo =3D dwfl_standard_find_debuginfo, .section_address =3D dwfl_offline_section_address, .debuginfo_path =3D &debuginfo_path, }; int main (int argc, char **argv) { Dwfl *dwfl =3D dwfl_begin (&dwfl_callbacks); Dwfl_Module *module =3D dwfl_report_elf (dwfl, argv[1], argv[1], -1, 0, false); if (module =3D=3D NULL) printf ("%s\n", dwfl_errmsg (-1)); dwfl_report_end (dwfl, NULL, NULL); Dwarf_Addr bias; Dwarf *dwarf =3D dwfl_module_getdwarf (module, &bias); if (dwarf =3D=3D NULL) printf ("%s\n", dwfl_errmsg (-1)); /* ... do something with dwarf ... */ dwfl_end (dwfl); // Also cleans up dwarf. } But this is obviously a little cumbersome if not really using any other lib= dwfl features. --=20 You are receiving this mail because: You are on the CC list for the bug.=