|Freedom of Speech, Privacy, Science|
I have not received any National Security Letter.
Please join the Electronic Frontier Foundation ( EFF.org ) and the fight for your rights on the Internet.
Please join the Union of Concerned Scientists ( uscusa.org ) in bringing science into improving all our lives (everyone is welcome to join).
Public Domain works are a vital part of any culture and there are repeated attempts to erode the Public Domain. For more information see the Center for the Study of the Public Domain at Duke University.
libdwarf and dwarfdump are Free Software.
We do not get any corporate or government financial support for maintaining dwarfdump and libdwarf. A donation of just $5 or $10 a year to support the project would would be greatly appreciated.
If someone can put me in contact with the original author (Crablicious) of the libdwarf-addr2line github project somehow I would appreciate it. Thanks.
The distribution consists of C and C++ source code that you compile with your C/C++ compiler (documentation is included).
The DWARF Debugging Information Format is of interest to programmers working on compilers and debuggers (and anyone interested in reading or writing DWARF information). It was developed by a committee (known as the PLSIG at the time) starting around 1991. Starting around 1991 SGI got involved with the committee and then developed the libdwarf and dwarfdump tools for SGI-internal use and as part of SGI IRIX developer tools. From around 1993 dwarfdump and libdwarf were shipped (as an executable and archive respectively, not source) with every release of the SGI MIPS/IRIX C compiler. In 1994 (I think the correct year) SGI agreed (at my request) to open-source libdwarf (and in 1999 to open-source dwarfdump) so anyone could use them.
BIG-ENDIAN system support has been provided by the IBM linuxone project starting in 2019. We now can test on a big-endian s390 system in a Linux VM. Thank you IBM. As of 06 October 2019 libdwarf dwarfdump and readelfobj/readobjpe/readobjmacho pass -all- tests on an IBM big endian machine, one is happy to report. Please advise of anything not working correctly!
In May 2019 we made the first release (20190505) with the option of building libdwarf and dwarfdump without any libelf. In November we implemented comprehensive testing across a variety of OSs and machines.
In September 2021 we fixed every problem Coverity Scan could find, and we continue to have zero defects.
License terms are mostly GPL (version 2) or LGPL (version 2.1). A few files use the FreeBSD (2-clause BSD) terms. The details are discussed in the license page.
DWARF specifications and the dwarf email forums are at http://www.dwarfstd.org. You can sign up for an email discussion list there.
Email about libdwarf and dwarfdump may be sent to libdwarf-list -at- linuxmail -dot- org (replace -at- and -dot- with the normal single characters to form the email address). [top]
Beginning May 4, 2014 a number of critical vulnerabilities in libdwarf and dwarfdump were reported.. Critical because these lead to serious difficulties where the application calling libdwarf could crash (segfault, etc), leading to a Denial of Service.
All the known vulnerabilities have been fixed.
For a list of the known vulnerabilities see https://www.prevanders.net/dwarfbug.html
https://www.prevanders.net/dwarfbug.xml is an xml version of the same data.
Coverity Scan uses synthetic execution to look for defects.
ci builds on Linux, Freebsd, msys2, and MacOS using configure, cmake, and meson.
Regression testing runs about twenty thousand checks comparing the last good dwarfdump versus the latest version. With all dwarfdump options exercised to touch as many code paths in libdwarf as possible. And involving numerous corrupted objects to check error code paths.
The regression tests are run in 32-bit and 64-bit machines/VMs. Including a 64-bit big-endian environment.
Running scripts/buildandreleasetest.sh demonstrates that a build and a test release libdwarf-<version>.xz and then build out of the a test release works and a second release build of libdwarf-<version>.xz from the first such contains the same files as the initial libdwarf-<version>.xz The script verifies cmake (with some cmake options tested) work out of the test release too.
After relevant pushes to github we run several github workflows and a Travis-CI build as an independent verification things build. The status of each test is shown above.
Coverity Scan is run before every release (and sometimes more frequently) to ensure there are no faults found by its synthetic execution of the source code.
An open source tool named github.com/nimble-code/Cobra does source scanning and finds instances of C coding that is not following best-practices. For example, it finds macro arguments are not inside parentheses at the use inside the macro. It detects many different things, reporting where best-practices were overlooked. Sometimes its pattern-matching mentions things that are not real issues, so one has to apply judgement. But it's quite useful. The best-practices lead to greater code consistency and readability (and sometimes reveal a bug).
Up through mid-2021 releases were identified by an ISO date such as 20210528. This makes the release date clear but gives no clue what the differences are between releases.
Transitioning from ISO date to semantic versioning is must be done in a way that will be generally understood, a way consistent with standard practice.
Semantic versioning, a more standard release id, is a triple of numbers like x.y.z meaning major.minor.micro (some projects add suffixes). See Software Versioning.
If api is changed or removed, ++major, minor = micro = 0 If api is added ++minor, micro = 0 If bug is fixed ++micro
This form makes clear the changes.
It's now common for libraries to provide a .pc file which provides useful information for library builders and library users. See the pkg-config command and Pkg-config on wikipedia.
A more usual approach to such is (here tests means basic sanity tests):
code/ src/ lib/ (libdwarf, libdwarfp) bin/ (dwarfdump, dwarfexample, ...) tests/ scripts/
The Meson build system is python-like, is much much faster than configure or cmake, and is easier to work with once one is past an initial learning curve.
The original functional interfaces to create DWARF data, the producer interfaces required casting to determine success/failure. The old ugly requires-casting interfaces have been removed.
Many consumer interfaces appear in multiple versions. For example, dwarf_next_cu_header(), dwarf_next_cu_header_b() dwarf_next_cu_header_c(), and dwarf_next_cu_header_d(). In all cases the one with highest letter (_d in this example) will be kept and the earlier ones were deleted as the earlier ones do not handle all of DWARF<n> for some <n>.
In nearly every case the differences are very small: The addition of an argument to handle a DWARF Standard change was the motivation for all of them, and in many cases simply passing 0 for the new argument works like the older versions (though that is not recommended practice since it won't deal with some recent DWARF5 fully).
The following are no longer used or needed: HAVE_OLD_FRAME_CFA_COL and HAVE_SGIDEFS_H HAVE_ELF_OPEN HAVE_GLOBAL_ALLOC_SUMS HAVE_NONSTANDARD_PRINTF_64_FORMAT HAVE_SGI_IRIX_OFFSETS HAVE_STRICT_DWARF2_32BIT_OFFSET HAVE_DWARF2_99_EXTENSION In addition HAVE_STDLIB_H HAVE_STDDEF_H HAVE_STRING_H are no longer needed, those are standard headers beginning with C89/C90 so are assumed present.
Because tsearch() itself is not universally available (and even when tsearch() is available tdestroy() is sometimes not available) I implemented some tree algorithms using the standard tsearch interface definitions.
For more information see the tsearch page
The basic four tsearch standard interface declarations are quite old, traditional, incompletely documented, hard to use, and not at all what anyone would design as an interface today. But these four functions are declared in the Posix/SingleUnixSpecification standard so we support them.
The algorithms implemented are binary tree, binary tree with Eppinger delete, balanced binary tree, red black tree, and a hashing (non-tree) version). The function interfaces implemented include tsearch(), tdelete(), tdestroy(), tfind(), and twalk().
To avoid conflicts with standard library versions all the function names are prefixed with dwarf_. Libdwarf and dwarfdump use the new tsearch.
Four object tools are included. Three print object section header information. They all read object files and report information about the sections and content.
For more information see the readelfobj page
See https://github.com/davea42/readelfobj-code for the README and to download a release.
readelfobj prints Elf object headers. It has options to print details on more than just section headers.
readobjmacho prints MachO object headers relevant to DWARF information.
readobjpe prints PE (Windows) object headers. relevant to DWARF information.
object_detector decides if a given object is Elf, MachO, or PE and returns information saying which format it is or reports the format is unknown.
The indent-checking tool
useful in case you make source changes and want
to preserve proper libdwarf indentation.
See more details on
the github page for the tool.
Clone a copy of the source code with
"git clone https://github.com/davea42/libdwarf-dicheck"
which creates and populates a directory named "libdwarf-dicheck".
All libdwarf distributions contain C source plus the DWARF2 specification plus libdwarf specifications. Implementors often extend DWARF by adding new attributes and other things. Those that we are aware of are defined in dwarf.h which is provided here for reference. If you have corrections or additions, please let me know! The file is in every distribution of libdwarf.
Beginning 14 May 2021 libdwarf source code is available via anonymous access from github as well as Sourceforge:
"git clone https://github.com/davea42/libdwarf-code code
initializes a git repository in the local directory it will create named "code" and populates it with the most up to date libdwarf source. See the README and README.md for the new June 2021 build instructions.
Since github has programmable APIs you may wish
to switch to accessing the project from github.
Since 19 March 2011 libdwarf source code has been available via anonymous access with git from SourceForge.net. As of June 2021 those wishing to see the latest should use github.com as the source because sourceforge.net is not up to date with the libdwarf source. The git source code is the reference source: it may have features or fixes not in a tar.xz release, but if so the features or fixes are not needed by most people. Top-of-trunk code in the git repository has been fully tested. See the github clone command above.
Here is a complete build example using github. Note that these instructions are not up to date with top of trunk. To save space here, we are not building optional programs and not doing any checking for failure at any step. In some environments configure options may be necessary, but none are shown in this example. Later sections here on building show some additional configure options.
# github example git clone https://github.com/davea42/libdwarf-code code # See a README in the distribution for further instructions.
Some small object tools are available in source via anonymous access. See the readelfobj page for details.
(which you really don't need or want)
"git clone https://github.com/davea42/libdwarf-regressiontests regressiontests "
which creates and populates a directory named "regressiontests". The "regressiontests" directory should appear in the same directory as the "code" source code directory as the regression test scripts reach around to the source at certain points. As of 09 November 2020 the regression tests can be run in a temporary directory with something like
mkdir /tmp/dwtests cd /tmp/dwtests /path-to/regressiontests/configure make
The libdwarf build process involves a simple traditional approach (at least for personal use, people generating binary releases or a corporate library will have their own internal requirements to consider). In the base directory of the source distribution (either expanded from a tar.gz or from git) do the following:
If all goes well, this will build libdwarf and dwarfdump.
It's common to do the build in a separate directory. As an example of building all the executables using a separate directory, do something like:
# Assuming the source top-level is in /path/to/libdwarf-20180809 mkdir /tmp/bld cd /tmp/bld /path/to/libdwarf-20180809/configure --enable-dwarfexample --enable-dwarfgen make
which will build libdwarf, dwarfdump, dwarfgen, and dwarfexample in a minute or two. You don't need dwarfgen or dwarfexample. If libdwarf and dwarfdump complete their build you have most of the functionality you need. dwarfdump (written in C) lets you dump out, in readable form, the DWARF2, DWARF3, DWARF4, and some DWARF5 data from an object file. (the DWARF5 standard was released on dwarfstd.org in February 2017).
There are some prerequisites you must have installed on your build machine:
C compiler (Conformant with the 1989 or later C standard. Support for the 'long long' datatype is required.) C++ compiler (only needed to build dwarfgen) libelf is optional (however it is required to build dwarfgen) zlib (if your compiler uses compressed sections) See the top-level README in the source for specific references for libelf and zlib.
Contact the libdwarf-list email address before attempting to contribute any code.
On Windows Use of one of the POSIX-like environments like mingw or cygwin or the like will ease your way. You may find cmake very useful on Windows.
The regression test build process involves rather more work, and few will want to bother with it. There is no tar.gz available, you have to use git. In the base directory of the regressiontests distribution do the following (if the base of the libdwarf source tree is at ../code this should work, but if not see the regressiontests/README.txt file):
Rather than keeping known-good output in the regression-tests, we keep a dwarfdump.O (O for Old) to compare its output against the new dwarfdump. We do it this way as the test output is much too large to save.
To run the dwarfextract test successfully, bfd.h needs to be installed in a standard place, so install binutils-dev (or the equivalent for your release) to get bfd.h. We do not link to the bfd library.
In the regressiontests directory do the following.
In the code directory there is a test script that does all the tests including building releases, using cmake and more as well as running the regression tests.
sh scripts/run-all-tests.sh >& /tmp/results # The following is a passing run. grep FAIL /tmp/results # XFAIL: 0 # FAIL: 0 # XFAIL: 0 # FAIL: 0 # XFAIL: 0 # FAIL: 0 # XFAIL: 0 # FAIL: 0 # XFAIL: 0 # FAIL: 0 # XFAIL: 0 # FAIL: 0 # XFAIL: 0 # FAIL: 0 FAIL 0 FAIL 0 FAIL 0 FAIL 0 in run-all-tests.sh
grep FAIL /tmp/results should show all zeros (there should be about 18 lines)
On a modern 3GHz-cpu Linux environment running directly on the host the tests should run in about 35 minutes and the final message should say PASS. Running in a KVM Virtual Machine the tests run in 45 minutes or more. Unless all the components in the libdwarf source build correctly the tests cannot pass.
Unless you are running Ubuntu GNU/Linux or FreeBSD 12 on a i386- or X86_64-compatible cpu you may have more work to do to run the tests, partly because the tests depend on having a known-good version of dwarfdump in the distribution.
If the Ubuntu or FreeBSD dwarfdump executables in the distribution won't run in your test environment you could build dwarfdump.O to run tests:
As of release 0.3.1 releases are also available for download from the github libdwarf page
|filename, download-link||Bytes||Reason for release|
Date: 2022-09-13 Fixed libdwarf crashes in certain fuzzed object files. Fixed all known instances of leaks in dwardump and libdwarf, so neither valgrind nor -fsanitize can find leaks, even when malloc is failing due to running out of memory. dwarfdump no longer prints anything to stderr, all output goes to stdout (libdwarf never prints anything).
sha512sum (remove spaces following colon): 6d2a3ebf0104362dd9cecec272935684 f977db119810eea0eec88c9f56a042f2 60a4f6ed3bbabde8592fe16f98cbd81b 4ab2878005140e05c8f475df6380d1c2
Date: 2022-06-25. Two places where a carefully corrupted object file could result in libdwarf crashing a caller due to referencing memory outside the intended read area have been fixed (DW202205-001 and DW202206-001). One related to DW_FORM_ref_sig8, the other to the .debug_pubnames section. The library now accepts DW_AT_entry_pc in a CU DIE as a base address when DW_AT_low_pc is missing (an extension used by a current compiler). Added function dwarf_suppress_debuglink_crc() to allow callers to turn off doing a CRC calculation reading GNU debuglink data (saves time for library users accessing near-identical builds).
sha512sum (remove spaces following colon): 793fe487de80fe6878f022b90f49ec33 4a0d7db071ff22a11902db5e3457cc7f 3f853945a9ac74de2c40f7f388277f21 c5b2e62745bca92d2bb55c51e9577693
Date: 2022-04-12. Made changes to 6 interfaces to make three dealloc functions be named with a pattern consistent with the rest of libdwarf, a function reverted to a pre-DWARF5 version for correctness, and changes to the .debug_names API functions to enable full access to the section. See details in the Recent Changes section of libdwarf.pdf. dwarfdump now prints all the information in .debug_names with --print-debug-names.
sha512sum (remove spaces following colon): 30e5c6c1fc95aa28a014007a45199160 e1d9ba870b196d6f98e6dd21a349e9bb 31bba1bd6817f8ef9a89303bed056218 2a7d46fcbb36aedded76c2f1e0052e1e
Date: 2022-02-23. Fixed a bug in test scripts so 'make check -j8' will work properly. Fixed a bug where reading a PE (Windows) object could fail for certain section virtual size values. Added initializers to two uninitialized local variables in dwarfdump source so a compiler warning will not kill a --enable-wall build. Replaced the libdwarf.pdf content, it is now generated by doxygen and latex and has a proper table of contents and index. Added support for the meson build system. Added dwarfexample/showsectiongroups.c so one can see libdwarf's interpretation of section groups; making it simple to use libdwarf when section groups are important (relevant for Split Dwarf and COMDAT sections).
sha512sum (remove spaces following colon): 6957e6c696428b7e59c57e48279528ff 602c49ab9833e56a4722f173240eb137 3ddd20f5c9dae7c25cc64e6c2131d3b7 b5abcf3c12614b88858bdc353a441359
Date: 2022-01-26. Removed assignment offset = offset as a compiler detected the pointless assign and issued a warning, stopping a -Werror (warnings treated as errors) build of dwarfdump.
sha512sum (remove spaces following colon): e79266e28b2468ec89edfe70f27f574e fe784bd4ce663907f539cbe99d021c07 7ec7dcc4b31e9008e1eb418847fa47e8 0bb4d436b907fdad148a4e4da0c3346d
Date: 2021-12-25. No API change. Fixed one bug handing certain extended LEB numbers when the producer added padding inside the value (allowing padding is not defined in the standard but is not forbidden either). Moved and renamed many filesso the source directories look much better and cleaner.
sha512sum (remove spaces following colon): 4898f3b4dc40a9e5bfd91160506dd4a7 5b5a6e6d3c8eb0c8bc64f90c69eacf7a c9ffc8cdad5ef73df7db9eeef408aafe 599f43087e98e06281c2419741930f69
Date: 2021-11-24. libdwarf-0.3.1 has improvements in detecting corrupted Elf and MachO object files. The release adds a new function dwarf_get_frame_instruction_a() that enables access to new LLVM frame extension instructions involved in Heterogeneous Debugging (the new instructions have one more operand than any other frame instructions). The existing dwarf_get_frame_instruction() works on all frames and unless one is doing Heterogeneous Debugging one should continue using dwarf_get_frame_instruction(). dwarf_get_frame_instruction() was new in libdwarf-0.3.0 and is the first libdwarf function to enable extracting frame (CIE/FDE) instructions in detail without fiddling with the bit-structure in DWARF frame instructions.
sha512sum (remove spaces following colon): dd82174bcb36c32be564be747898ef09 aaaa5ecc84d211bac725edf9ba55008b 3942452d6684da79a320289986b45e16 4bbeefb5a07658daf473b143dfe40f2b
Date: 2021-10-30. Release 0.3.0 passes coverity scan with no errors/warnings. All known problems with functional interfaces have been fixed, no further changes are planned. All useless public structures in libdwarf.h have been removed, and no further changes to public structs will be made. In other words, aside from adding new interfaces where such are missing, this libdwarf.h and libdwarf are now stable. The doc/libdwarf.pdf documentation now documents all available library functions and only those functions.
sha512sum (remove spaces following colon): 775c5e8089d13ad1602f24fad51502fb 40d9e2ae281f523def7d066c876228e1 a71d6d04b7d89df1d65e664b56beddaf 992939d8606fed743a5b5264e6bf7f53
Date: 2021-09-20. Release 0.2.0 passes coverity scan with no errors/warnings. The release changes some libdwarf initialization functions to a form suitable for DWARF2-DWARF5 (by removing pointless arguments). All obsolete function interfaces have been removed (they all have modern replacements with similar spelling). Aside from a single function, dwarf_expand_frame_instructions() (which only works for DWARF2 and will be replaced), all functions are usable for all DWARF2-DWARF5. See libdwarfreadme.html for details
sha512sum (remove spaces following colon): 30d4076f3bc699449de44ac73637ebcb 386fa548dbf7cc429628e54e6aa09bb6 9b10faa5c1d635249b2133354850f7e0 c78f9b55e4c4cbfea4fe04081fa9e9b7
Date: 2021-08-07. Now with pkg-config files generated. All the obsolete functions have been removed. The DWARF5 .debug_names section is not yet fully supported. Tested against the full regressiontests. DO NOT use the function dwarf_skip_leb128, which appears in this release libdwarf.h for the first time and is dropped from 0.1.2. It is not documented. Making it public was not a good idea.
sha512sum (remove spaces following colon): eb2502d847fd5ee15928651dcc1ef30d ab04b7e65d7e772dd245da74bb071ce5 25cfdf97d1af5dbceb50c1a12cccda5c 762f461d03a16c55557ab5e94e79e8ab
Date: 2021-05-31 This is a first release with a new source and build directory structure, and the first tarball with a semantic-version identity and no other changes from 20210528. Soon there will be major revisions. Here the main documentation is renamed libdwarf.pdf, libdwarf no longer uses libelf, and dwarfdump no longer reads archive (<name>.a) files. The Elf object-file printing features have been removed from dwarfdump (the -E and -o options). Interested parties might like to give this a try. Fully tested against the full regressiontests.
sha512sum (remove spaces following colon): 9e8149a8548e31a08acade31be796899 94fd7e635c9be8ace7a6c47b1f8e7b77 b2e3c9cf452a39a013442562b49fc1fc 04b9535fec5f9fa90df3e7fcb43fe27f
This release corrects libdwarf's handling of DWARF5 line table header DW_LNCT entries. Dwarfdump now prints DW_OP_bra and DW_OP_skip correctly and correctly validates the target of these operators.
sha512sum (remove spaces following colon): e0f9c88554053ee6c1b1333960891189 e7820c4a4ddc302b7e63754a4cdcfc2a cb1b4b6083a722d1204a75e994fff340 1ecc251b8c3b24090f8cb4046d90f870
This release adds summary information on attribute/form-class uses and attribute/forms use to the existing option -ku summary on tags and attributes. Dwarfdump verifies many attribute references are usable and prints a little from the target DIE, including with DW_FORM_ref_sig8 references. Now dwarf.h shows many more extensions (added by compiler developers) to the TAGs and ATtributes defines. Alongside releases is a pdf, libdwarf2.1xl.pdf (xl.pdf as it is extra-large), that is the same as the latest libdwarf2.1.pdf but with the table-of-contents at the front, not the back, of the pdf. Created an experiment, it is around 15MB so seemed too large to place it in the release or to do multiple versions. Later updates will just replace it on prevanders.net.
sha512sum (remove spaces following colon): 6fa05cf88125a95ebe38673d62e94470 1fdd28ba5c50f7695037acbc386f29b4 1d6551d9d08283b7d24fba02f3c0d6c8 f5d424ee75989b6aef54f8dc2340d0f5
Added checks for corrupted DWARF. Improved printing with --print-debug-gnu. Printing of DWARF Expression operators is much easier to read now. The regression tests can now be run in a temporary directory, keeping the test source directory clean.
sha512sum (remove spaces following colon): 246a08b1983e3d765a0516068066ea1c 9ddb3d04d6c25dae73ae251542c9c1f2 8c340ecc50cb2adda7ffea7773d7d615 b7826f85b56e6859ba889301d72e8a85
Corrected the printing of DWARF5 line tables, rnglists, and loclists. Now follows GNU debuglink rules to find the object file with debug in it (when that applies). A new dwarf_init_path_dl() function gives callers needing every feature of GNU debuglink flexibility the required new arguments. Added checks to catch corrupted Elf and PE objects as soon as possible. See the introduction in dwarfdump.1 for a short overview of GNU debuglink, DWARF5 split-dwarf, and MacOS dSYM.
sha512sum (remove spaces following colon): 5c1078440c4afc255ce9597e1fca9661 5b9b41c88fe33c18a1fdc140ec1dee83 5bd926473535fcacb2f8d3c8fd63349c 24e89e71a2d1a2319408a970f7bfa320
Fixed errors in handling split-dwarf so we get more complete information when dwarfdump/libdwarf see both the dwp and the executable. Added some well-known GNU TAG/ATTRIBUTE to the extensions list so dwarfdump will not complain with -ka.
sha512sum (remove spaces following colon): ef7578d5a07d45ded0e5e641ac69b917 ace33bd94efcad7d87b5d1960d7e4883 9095b480b086c84326fc2f15a9e9cfb6 ea7a51d8fffe2f63f50b4b8bd5fdbd39
Added some tag-tag and tag-attribute relationships for DWARF5 and some common extensions to their relationship lists so the -k options do not report these as issues to check. Now libdwarf reads and dwarfdump can print the DWARF5 .debug_sup section. And similarly for .debug_gnu_pubnames, .debug_gnu_pubtypes. A bug in dwarfdump that could lead to a small one-time memory leakage is now fixed fixed.
sha512sum (remove spaces following colon): d474482a7391ca660fa08c2f52ef1c29 61b7c2e7e5b92bf733a9996b7f610ec2 27ff6ea00401f0b4fcd897552fc3b0b0 54e706a36aaffe10841a383391e013a0
Adds support for DWARF5 rnglists and loclists. See the documentation for dwarf_set_de_alloc_flag(0) in libdwarf2.1.pdf, this offers improved libdwarf performance (but requires diligence).
sha512sum (remove spaces following colon): bf0ea33b166d1a5723f67022282eeb2f 374425e8bf3887cde843bcec8d47036f c5c2d713311e09f43ea93b79616a4743 a0394bcd3820f871243a37c0982358c3
The documentation of dwarf_init_path() has been clarified. A couple of memory leaks in handling rare errors have been fixed. The dwarfexample directory has a new example relating to the gnu debuglink features in gcc that allow one to find where any separate object files containing DWARF are located.
sha512sum (remove spaces following colon): b8ed28f0a7e0f537331cdcb1c9a4faf2 5103a70dc9e0f6985a836c4b84bd762e 3631586105abc7a2632e2d35048217d7 9097dccafbb328f56752cb85990e222a
The code and regression tests now work properly in more environments. Including Ubuntu Linux little-endian, big-endian Linux machines (s390), MacOS Catalina, and FreeBSD, and MinGW. 32bit and 64bit systems. No libraries other than libc are needed to build libdwarf or dwarfdump (certain object files use libz compression for DWARF sections and reading those does require one have libz linked in).
sha512sum (remove spaces following colon): 21cac4dc003ebb941a4aeb02454dfff4 afddfbfca1bec7f595a25b8659110d76 cdbb2ccb1c1c2290d94d62ed1c34e71d 5fa469389752c4599f1a76a445a16b4a
Numerous small improvements have been made. Clarifying code, ensuring 'make check' really shows dwarfdump and libdwarf work, and ensuring that 'make check' works under mingw (win32) are the main points.
sha512sum (remove spaces following colon): 0d8b89a91d10badb40137a2c49e897e6 d6beac7176fe877bd52b147a1f3307d9 d0866398b0992c1ce50f8599b9ddce04 fb82e8eeba6bbf6e80b581f96946a938
The build now works for more environments. The cmake support is now simpler and more complete. We now test in big-endian as well as little-endian systems (dwarfgen does not work properly in a big-endian system yet).
sha512sum (remove spaces following colon): 495f194e5be0537b351b359d8529ab7f 89fc93bedd8950526c9d0a7bbf4df112 730b27339434d3ae8fac516db6bbce59 ea5aca2236ee16c21213de0d9b0840ad
It is now straightforward to build a libdwarf and dwarfdump that do not rely on libelf yet will read and process Elf object files. The build with configure is simplified as much unneeded code has been removed. For example all uses and configuration of __UINT32_t and other related integer types have been removed. The cmake build is simplified with configure-isms removed and now works better with MinGW, MSVC, and systems with struct _Elf (example: FreeBSD). Code calling the libelf-only interfaces dwarf_elf_init() and dwarf_elf_init_b() will, when the called libdwarf was built without libelf, get an immediate error return.
sha512sum (remove spaces following colon): 0bd22bc62c72819198917a7fd2585905 2913e38bd2b09a73ccaa8e57c9ed072b 8f14763c5b34b6dcb91e9f904535ced1 122cfd9d5e036d07508c478b30522726
The problem with libdwarf-20190104 is fixed.
sha512sum (remove spaces following colon): 417f17e73cd1ef66c3b049892d893883 95255ebe65808da803084bd929360aec 350c38877ec438a797b5920d2bb363dd 76f938a653da15de13f145a27f6bc567
Do not use! dwarfdump and libdwarf now read and dump DWARF information from Elf, Mach-o and PE object files. January 9: a serious new bug was discovered today. If an object file fails a particular check in libdwarf then libdwarf will crash the caller. Reading valid object files will not crash the caller. Git commit fa5a44c378b0e5a5ba67d8871ac3b325f71f15a9 and later (pushed to Sourceforge) have this fixed.
sha512sum (remove spaces following colon): 6f6891df47cd76aa8ee5cbbad91c43de2c6a9b6cee2 7c8f5f64dc9df3e37c577718f8056e7a71fba6215c7 751ccb834935f52532032eb16bae2c26b3a3450677
Do not use this. It's deleted. See 20190104 (above) instead. A new function (dwarf_init_path()) did not have adequate regression testing and Coverity static analysis identified six or so problems in that code.
sha512sum (remove spaces following colon):
Dwarfdump now has meaningful long-option-names available for all its options. dwarfdump --help-extended shows the list of all options. Thanks to Carlos Alberto Enciso for conceiving and creating the long options. Now libdwarf/dwarfdump can read/print DWARF from mach-o dSYM objects as well as Elf object. Thanks to Eeri Kask for providing help, the impetus to make it happen, and test objects. A libdwarf init call (dwarf_init_path()) is now available. dwarf_object_detector_path() (and dwarf_object_detector_fd()) inform callers information on what an object file actually is (elf, mach-o, or PE). (post release discovery: "dwarfdump -h" does not work usefully. Oops. Use the long-option --help-extended instead.)
sha512sum (remove spaces following colon): 134f8639c4a2ddf012ab196551bcc9afc65c729b36 299ebf807de94561fe878473ea58443d33daaa96f0 08b28dd169ab29f65616e9f1e44a6e7921cfde6e3f19
The new configure seem to be working properly now. For example, 'make check', 'make install' and 'make dist' do the right things whether run in-source-tree or from a build directory. In addition, dwarfdump prints information on section compression (for sections that are compressed) and always prints the actual section name from the object file.
sha512sum (remove spaces following colon): 3c1a97e5b0bae0f18d02402c7b67b1e7 4aacd26b68b738afe5be8e446bdbdd9b 1189658779b8c65cddba40dbd7848d40 510c03eec258708956209b2d76f5dd66
News 2018-07-31. While usable there are issues here: make install does not install the dwarfdump.1 man page . make install installs more into /usr/local/share/libdwarf than was really intended. libdwarf.so shows as version 1.5.0 which was not intended. Replacement coming soon. But if the issues don't matter to you it's fine to use. Replaces 20180723. This release has the new configure. The configure options are mostly identical to previous releases. See the README in the top-level. Profound thanks to Vincent Torri for writing the new configure (any mistakes here are undoubtedly mine, though). Thanks to Hannes Domani for applying Coverity to libdwarf which identified over twenty previously-unknown bugs quite precisely (all fixed now). Thanks to Tom Hughes who noticed an omission in the alpha-non-release July 6. It is quite possible that something important to you is broken. Get in touch as soon as possible if you think something is wrong.
sha512sum (remove spaces following colon): 8eaa9f6ef147a1f59035a4ced24912b4 d1adecf6338a8ae7a061ab396519011c 2c98bc3d58534fefa2bac2a68d3f1871 999f75a3a820c6a58ca7b34dccf9a9c1
Withdrawn. The tar.gz file is missing libdwarf.h.in so attempts to build on FreeBSD (and possibly other platforms) will not succeed.
NOT A NORMAL RELEASE: this is a test release that will be added to Sourceforge on or after July 17, 2018. It uses a completely rewritten configure setup that uses automake and libtool yet one uses configure almost identically to releases of the past; the point is easier source maintenance and additional automation. It passes the usual tests on both Ubuntu 16.04 and FreeBSD 11.1 with 32bit and 64bit pointer environments. See the top-level README. This source is not on Sourceforge, it is only available in this .tar.gz Try it out. Let us know of any difficulties. Make install fails to install dwarf.h and libdwarf.h . The tar.gz here does not have the one-line fix. Email to: libdwarf-list =at= linuxmail =dot= org
sha512sum (remove spaces following colon): 3db4f472906bcb108493b0c85085d635 dde1df59a285989f6720554243ae8ec7 1510c9fadd1c59abf43c6211cf446f62 fb78f2276193adb1a8230d6c1ab6e971
libdwarf: Improved error checking and made cross compiling possible. Possibly all DWARF5 is supported. dwarfdump: Brought configure closer to current standards, enabled cross compiling. Now supports --longoptionnames. Refactored option/flag handling for easier maintenance. Now can print the .debug_str_offsets section with option --print-str-offsets. Thanks to David Blaikie,Carlos Alberto Enciso, Helmut Grohne,Eeri Kask,Pedro Navarro, Vincent Torri,Fabian Wolff, and Keith Walker for their test cases,assistance, and advice.
sha512sum (remove spaces following colon): f8f285373d03498e0bcf607d61cc0fb1 7b555ca48bbeda7c133a9c620e34b727 973aceecfa5402b53189211e3a0f15db e49951c2cf3e63e43775fbc8e9fbfa5d
Fixes libdwarf/dwarfdump vulnerabilities related to detecting corrupt DWARF and includes other small improvements. Thanks to Agostino Sarubbo, David Binderman, Eeri Kask, James Lowden, and Dvir Yitzchaki for their help.
sha512sum (remove spaces following colon): 02f8024bb9959c91a1fe322459f7587a589d096595 6d643921a173e6f9e0a184db7aef66f0fd2548d669 5be7f9ee368f1cc8940cea4ddda01ff99d28bbf1fe58
Fixes a libdwarf vulnerability. Thanks to Team OWL337 for finding the vulnerability and to Fabian Wolff for emailing an alert. Has updates to documentation on DWARF5 consumer interfaces.
sha512sum (remove spaces following colon): afff6716ef1af5d8aae2b887f36b9a6547fb576770 bc6f630b82725ed1e59cbd387779aa729bbd1a5ae0 26a25ac76aacf64b038cd898b2419a8676f9aa8c59f1
Begins to support the DWARF5 .debug_names section and other DWARF5 changes. (not tested, no test cases yet available). Now supports DWARF5 split dwarf sensibly. The few new function interfaces can be ignored by those not needing split dwarf support. The tools can now be built with cmake (the default build is still with configure), thank you Dvir Yitzchaki. Carlos Alberto-Enciso, Emre Kultursay, Marcel Bohme, Van-Thuan Pham, and Alexandr Terekhov all noted bugs or vulnerabilities and these are all fixed.
sha512sum (remove spaces following colon): 85be7ec806029200648514b965e23e163a54cbdc6f2 feba0d4cc96180bab441f85d22640c7a96d6350b8f8 749b7bcbe2f0f1af0865f9a427f2acce5135c4e630
Fixes some newly discovered vulnerabilities (most due to corrupted DWARF). Thanks to Puzzor (Shi Ji) and Agostino Sarubbo for finding and reporting these and for providing short test cases.
sha512sum (remove spaces following colon): 38e480bce5ae8273fd585ec1d8ba94dc3e865a0ef3fcfcf3 8b5d92fa1ce41f8b8c95a7cf8a6e69e7c6f638a3cc56ebbf b37b6317047309725fa17e7929096799
Fixes one place where erroneous dwarf not caught, Updates version strings, adds a bit more DWARF5 support, and converts the few Python scripts from python2 to python3.
sha512sum (remove spaces following colon): 733523fd5c58f878d65949c1812b2f46b40c4cc3177bc 780c703ec71f83675d4b84e81bc1bcca42adf69b5e122 562e4ce8e9a8743af29cc6fafe78ed9f8213fd
Fixes serious bugs in release 20160929 and all earlier releases relating to encoding/decoding leb numbers. It is unlikely anyone will see any difference in output, but values showing a difference can be constructed. libdwarf/dwarf_leb.c has new test code and a few of the tests there demonstrated problems. gcc -fsanitize=undefined found problems as well.
sha512sum (remove spaces following colon): 2c522ae0b6e2afffd09e2e79562987fd819b197c9b ce4900b6a4fd176b5ff229e88c6b755cfbae7831e7 160ddeb3bfe2afbf39d756d7e75ec31ace0668554048
|libdwarf-20160929.tar.gz||Withdrawn. See 20161001.||
Fixes three serious bugs in release 20160923. Two of them old bugs, one new in 20160923. The bugs were exposed by occasional inconsistent behavior in one or two regression tests.
DO NOT USE: use libdwarf-20161001 instead. Think of this as withdrawn. Many improvements in the code catching corrupt dwarf. Quite a number of places with out-of-bound read/write of memory fixed. Trivial but annoying memory leaks in dwarfdump fixed. Thanks to Puzzor, STARLAB, Salvatore Bonaccorso, Agostino Sarubbo, Vul, James Grumbach, and others for reporting memory corruption and other issues.
sha512sum (remove spaces following colon): 941c16dd487e152e34f83a8d1f5eb2992fb8c9fb7a 6309c7c33825267c95614c2a07ef24b205de287344 9b16df1749f9e9a0b9d1c85b64a635180ade073aeb66
Incorporates code detecting malformed DWARF and malformed Elf object files. Dwarfdump and libdwarf performance reading frame data improved significantly, though the improvements don't apply to all frame data interface functions. The configure/make system now builds libdwarf shared objects (when asked to) with a proper soname. Thanks to Sture Carlson, Hannes Domani, etienneberg, Steve Kaufman, Yue Liu, and Fabian Wolff for their help/comments on libdwarf. Major thanks to Carlos Alberto Enciso for his collaboration.
sha512sum (remove spaces following colon): 430978587e284f4c63e54790a7cbbfdf13c7a4154b 9e130dc788869b6c6584981c5af46b7b363d3b181e aaafd5190bcb17e5383f8600cb1d2627c423a7042dc2
Incorporates many additional checks so that corrupt dwarf will not crash an executable calling libdwarf. Thanks to Yue Liu for providing a number of small and corrupted objects.
sha512sum (remove spaces following colon): 8a4d3721390d4d79fbf8d01fb27995ac9871f1d3e 19d85aa25c108ee4cc45968a5331e2b477f559168 c4597513235fb508bfe4ee1664c6dfbede3a47d48490b5
Now reads and prints DWARF5/4 macro data (The new .debug_macro section). Added some checks of abbreviation codes. Thanks to Emre Kultursay, Tom Kittel, Gernot Klingler, and Kubo Takehiro for suggestions and test cases. See the top-level README for hints on building the package outside of the source tree and building and using the shared-library version of libdwarf.
sha512sum (remove spaces following colon): 594519460d3cd3f60f7e97931ce3e3d775393e03068a 2c932d72ba95d8cdb2c53b622671c5af8a798712937b 62dbf9594e2da8945553a0021a275cf677f4d90a
Support for reading Split Dwarf object files provided. New location and location-list interfaces added for Split Dwarf and DWARF5. Uses new functions to pass location list data to callers, not publicly defined structures, as functions make any future changes to location information easier to support. Existing DWARF 2,3,4 location information interfaces retained for compatibility so existing calling code is not affected..
sha512sum (remove spaces following colon): 22c6a233cf156f3e7a8ad65c6b0f3c6b0de5a7ddc0f 1c71c9b2dc7efa59a4ee1c9714e981bb26d40a0c212 7501a3e853a7605af10be96bdcb0486723d4a1443c
Corrected accidental C99-isms, added missing return statements, and improved checking. Thanks to Carlos Alberto Enciso for these enhancements. I suggest using the git source base, it has some small fixes beyond this release related to new code for the .debug_addr and the .debug_str_offsets sections (DWARF5) and for reading gcc experimental two-level line tables.. Thanks to Emre Kultursay for encouraging me to add some needed DWARF5 features and for reporting bugs so the git source base gets corrected quickly.
sha512sum (remove spaces following colon): a567e653fdad598d911e2ed7e219945adbf0f00ef 8e81806e993916aacfc8075657ec3ca925e1efa85 c7860a0d9515cae2b04677dfb25ac416fb4cc47933441a
Strings are checked thoroughly to ensure they do not run off the end of their section without a termination and cause chaos in libdwarf. Now with DWARF5 (and DWARF4) Debug Fission support, so one can nearly transparently (see dwarf_set_tied_dbg()) extract addresses denoted DW_FORM_addrx in a package file from the executable with the .debug_addr section. Withdrawn as 20150915 has this and more.
sha512sum (remove spaces following colon):
Now with DWARF5 (and DWARF4) Package File reader support. Package Files are a way to keep DWARF debug information in a separate object file. DWARF5 is not a released standard, so the new features must be considered tentative.
sha512sum (remove spaces following colon): 3495f6c17b5ade3a9f38e4d92b63f318e1f69d8841 95e6eafecb99c49e9366ed5c0fbdabd15f6d3b79c9 426565a5960364bb1ac1d1cb185363318872cdf83520
Improved range checking. Fixed bugs in dwgetopt(). Added omitted tags and attributes lists in dwarfdump to make error checking more accurate. Where pc checks make no sense in a line table (meaning on DW_TAG_type_unit and children) such dwarfdump checks are now omitted.
sha512sum (remove spaces following colon): 983c0bb5d70f59e95b8b9de9cda74d714795526220 ac944b6e058554b1f1e831063ae5524d6a2de557e1 fe829ccbf17b1ab71195fa5589504ead3d94396ab0a4
The omission of an include of stdarg.h in the 20150112 release meant that standard-conforming compilers could get an error compiling dwarfdump due to va_list not being defined, though Ubuntu and FreeBSD compiles did not see such an error. Now dwarfdump does the include. The dwarfdump2 source has been removed as of this tar.gz file. Dwarfdump2 is no longer needed.
sha512sum (remove spaces following colon): abcc465f3fcc369143cb34976ad2874b5a9d2a6b4f732be2 b83b0e7620799747778947aed0c10872a5fad73443cfa986 48bdc50a3b17c98292a6439b54d60222
New checking options added to dwarfdump. Dwarfdump2 no longer updated or compiled. Improvements in internal checking to handle badly formed Elf and Dwarf files. Better recovery from malloc failure.
sha512sum (remove spaces following colon): 23fe3dec516a90c2cedb851971f2fd902e056bf4471a32 a2237881354d71af866fcdbc9d3ff55d4e83b75fdafd9f 7790bf90165506e9285259c67f342c4eccba
Source incompatibility for users of producer code: dwarf_producer_init() now has a new interface and a sensible way to select the output ABI/ISA for relocation numbers. Part of preparation to emit DWARF3,4,5. The reader code now handles DebugFission, called Split Dwarf objects in the draft DWARF5 standard.
sha512sum (remove spaces following colon): ccf8180b69cdb47902564dda1fca52d15c10239ce6bb8c c9f5af5a67d37f888811572e314414372bfbc2b640c1fff 7cf87542f782f8390f733d884a24d9a16fb
Libdwarf now follows the DWARF2 standard properly in reading DW_FORM_ref_addr. The original DWARF2 standard is on dwarfstd.org so it's gone from the libdwarf source.
sha512sum (remove spaces following colon): 7ecd27b40418fd98bb24ee59b9779efe30dca26384b4a36f5 a1b0a99805f4d8ff281b2e3d4470fb8e8da28045c34bf6b53 fdf85e9dfc5fa76c0eac8462ae8467
Fixed a bug in dwarfdump Makefile.in so parallel make works reliably. Removed remaining trailing-whitespace. Moved tsearch testcases over to the libdwarf regressiontests repository as the tests seemed too large to keep in the source.
sha512sum (remove spaces following colon): d8ba3eeaf36d98a1ee26397208fff1658a2b7a41c 25d3742a81617c74d6359aeff08bb6221f99b9937 9030575578e11cd66be1d906a5832a6edd362229ce2e7e
Radically simplifies libdwarf allocation code. Adds GNU-specific DW_FORM codes so recent gcc objects can be read usefully. Adds tsearch implementations (see the tsearch directory). Removes trailing whitespace (it appeared all over). Adds new functions to libdwarf for new DWARF reference types. The tsearch test cases have bloated this source release, but in future those test cases won't be in the tar file (instead they are in the libdwarf regressiontests repository on Sourceforge).
sha512sum (remove spaces following colon): d41ebe4e7b76ad91f93b17e33da878fb0a35d7a35 32d641108b217bf93bcd9f10c1d52f0dd5f2ece08 3152d8dafe637ae343633f894122cbb77825b7a3350ed2
Added AARCH64 relocation support. Fixed some simple compiler warnings.
sha512sum (remove spaces following colon): f9d25cfd6c6b15bebf6cd63c7014ecf4123798fce637c 0da103008758d6a9d5705c3797216a8d1ab3e210c4235 f199ab19d7ed0bf6c3582f49eacba1629c5cc0
Now with a simplified build (see README) and with checks for most compiler errors in producing DW_AT_sibling attributes. Verified on Ubuntu 12.10 and FreeBSD 9.1.
sha512sum (remove spaces following colon): 1cb272f80745a789d592d57e6a64b1b4ec6e1b646653 da2f19c2e2d803b8e90b52f5c69597360bf1703b1c25 7844c53c3f43a80cd9f45a2adb314ad2511c19e9
A mistake in handling DW_OP_GNU_const_type could lead to a libdwarf coredump at times, and even when it appeared to work the value printed was wrong. Thanks to Tom Hughes and Andrew Bernat for pointing out the DW_OP_GNU_const_type problem. This release has libdwarf interfaces compatible with releases before 20130125. Compared to 20130125 this restores the libdwarf.h interface Dwarf_Loc structure and changes the way the lr_number2 member is used for the new location expression operator DW_OP_GNU_const_type.
sha512sum (remove spaces following colon): c9911ce0b9725400ec1a70e809e185b122095c534f05687 ea0be16a0e9bfe3b8128e353834c43b5fe80e1b149b11 f113fcce53c57bad0a12b3b091dd0e31d043
For information on previous releases, see the older release list
Every release of libdwarf/dwarfdump is tested with many options and option-combinations. There is no real reason libdwarf/dwarfdump users should need to redo this testing work. However, if you do wish to try running the regression tests, you will find them in git in Sourceforge via anonymous access "git clone git://git.code.sf.net/p/libdwarf/regressiontests". See the file README.txt in the base directory of the tests for an overview of the test process. We do not provide a tar file of the regression tests. The regression tests are updated with every libdwarf release.
Additional tests (simple object files or shared-objects or executables) are accepted here should you wish to submit such, but the goal is to add tests that represent previously-untested aspects of DWARF/libdwarf, not to duplicate existing tests. Smallish object files are preferred. No source need be provided. The submitter has to be sure, and state, that releasing the objects here is appropriate.
Nothing in libdwarf looks at very many sections of an Elf file: the other section contents can be zeroed out without affecting the object use for testing libdwarf (see the directory named 'zero' in the testing distribution for a convenient byte-zeroing helper application in C++ source). Sections like .text and .data (and closely related sections) are of no value for testing libdwarf. It may be that otherwise-proprietary objects can be released for use in this test suite once the instruction and data sections are zeroed out.
This work is licensed under a Creative Commons Attribution 4.0 International License.