This is the mail archive of the
mailing list for the elfutils project.
Re: libdw errors for DW_FORM_GNU_strp_alt attributes
- From: Mark Wielaard <mjw at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Mon, 07 Apr 2014 16:37:31 +0200
- Subject: Re: libdw errors for DW_FORM_GNU_strp_alt attributes
On Fri, 2014-04-04 at 13:47 +0200, Florian Weimer wrote:
> If I run the attached test program on the file
> /usr/lib/debug/usr/bin/bsdiff.debug from the Fedora package
> bsdiff-debuginfo-4.3-12.fc20.x86_64, I get the following output:
> Compilation unit at offset 0, tag 17:
> name (format 0xe): "bsdiff.c"
> comp_dir (format 0x1f21) present with error 36: no alternative debug
> link found
> producer (format 0x1f21) present with error 36: no alternative debug
> link found
That means those attributes use DW_FORM_GNU_ref_alt or
DW_FORM_GNU_strp_alt and are referencing a value in the alternative
debug file. The error means that alternative debug file wasn't found.
> How can I obtain these attributes?
If elfutils was configure with --enable-dwz then it should automagically
find the alternative debug (dwz) file. And it does for me on f20 with
Compilation unit at offset 0, tag 17:
name (format 0xe): "bsdiff.c"
comp_dir (format 0x1f21): "/usr/src/debug/bsdiff-4.3"
producer (format 0x1f21): "GNU C 4.8.1 20130717 (Red Hat 4.8.1-5) -m64 -mtune=generic -march=x86-64 -g -O2 -fexceptions -fstack-protector-strong --param ssp-buffer-size=4"
The alt file is found by inspecting the .gnu_debugaltlink section in the
bsdiff.debug file and resolving either the file name
is /lib/debug/.dwz/bsdiff-4.3-12.fc20.x86_64) or the build-id given in
that section (42643ed4e062195a11211c3696fc5e6cec73d0fb) which resolves
-> ../../.dwz/bsdiff-4.3-12.fc20.x86_64 (the same file through a soft
We currently don't have an interface to explicitly set the alt-debug
file for a Dwarf but should (and then the magic lookup should be moved
from libdw to libdwfl, but that has as drawback that a simple
dwarf_begin () won't set it automagically anymore and you'll have to
either use dwfl_begin () to set it automagically or use an explicit
setter for it).