Up to [cvs.NetBSD.org] / pkgsrc / devel / libdwarf
Request diff between arbitrary revisions
Keyword substitution: kv
Default branch: MAIN
devel/libdwarf: Update to 2.2.0 * Add buidlink3.mk for upcomming cad/nvc. Changelog: 2.2.0: Date: 2025-10-10 Added functions dwarf_lvn_name_direct() dwarf_lvn_name() dwarf_lvn_table_entry() to allow complete reading of DWARF6 DW_AT_language_version attributes. Fixed issues reading corrupted (fuzzed) Apple Mach-o object files: now the code immediately returns an error instead of seeming stuck. Fixed issues building with gcc option -std=c99 and the like. Corrected a bug reading line table data that used forms similar to DWARF5 DW_FORM_strx. 2.1.0: Date: 2025-07-20 Removed heuristic checs for decompression reasonableness as they failed on some real object files. Corrected handling and reporting of the DWARF6 attributes DW_AT_language_name and DW_AT_language_version. An object with DWARF and GNU debuglink data and nothing else is now correctly accepted and reported. 2.0.0: Date: 2025-05-20 Fixed a longstanding bug in configure.ac which began to cause builds to fail with recent autoconf. Fixed a problem in test/CmakeLists.txt that caused current builds to fail on Msys2 Mingw64. Updated the error report (for zlib, zstd) when decompression exceeds a heuristic limit. 0.12.0: Date: 2025-04-02 Improved the code in dwarfdump checking for valid address ranges (-k options).. Added the capability of using mmap instead of malloc in reading section data and functions allowing reporting on section malloc/mmap. Now detects duplicated attributes and generates an error and provides a way to suppress the detection (for cases where one needs to analyze an object that was created with a broken compiler). 0.11.1: Date: 2024-12-01 Corrected the reading of DWARF5 .debug_rnglists and .debug_loclists (with and without split-dwarf).. 0.11.0: Date: 2024-08-15 Added function dwarf_get_ranges_baseaddress() to the api to allow dwarfdump and other library callers to easily derive the (cooked) address from the raw data in the DWARF2, DWARF3, DWARF4 .debug_ranges section. An example of use is in doc/checkexamples.c (see examplev). 0.10.1: Date: 2024-07-01 Release 0.10.0 is defective, do not use it. A new doc/CMakeLists.txt file was left out and there were problems with the Version: in libdwarf.pc created by cmake or configure. 0.10.0: Date: 2024-06-24 Corrected the handling of DWARF5 .debug_rnglists and .debug_loclists. Has a mistake in generating libdwarf.pc and that leads to user build failures (when using pkg-config to find the correct shared libdwarf). 0.9.2: Date: 2024-04-02 Fixed four vulnerabilities that could crash the library (segmentation violation etc) reading specific corruptions to DWARF. DW202402-001, DW202402-002,DW202402-003, and DW202403-001. Now the library returns an error code for those. Corrected a dwarf.h misspelling of DW_CFA_hi_user. 0.9.1: Date: 2024-01-27 Altered the type of the return value of dwarf_die_abbrev_code() and dwarf_get_section_count() from int to Dwarf_Unsigned for consistency (should always have been this way). Problems reading Mach-o (Apple) relocatable object files are fixed. All three build systems have a option to turn off use of decompression libraries, see README.md and READMEcmake.md. All type warnings from MSVC are fixed. 0.9.0: Date: 2023-12-08 Added support for reading Apple MacOS universal binaries. Added callers access to certain fields from object files (for all three supported object formats), and added the --print-machine-arch option to dwarfdump to show the fields. Three functions were added to the API, see the Changes section of the latest documentation or in libdwarf.pdf in the release. No functions were deleted or had their meaning changed. Vulnerabilities found by fuzzing were fixed. See the dwarfbug page for vulnerability details. 0.8.0: Date: 2023-09-20 The release fixes many vulnerabilities from corrupt DWARF and/or corrupt Elf. Two new functions are added for DWARF Frame access to get the correct sign of an argument (the pre-existing functions remain in place and working avoiding any need for recompilation or relinking of user code). See the dwarfbug page for vulnerability details. 0.7.0: Date: 2023-05-20 The release fixes more than 50 vulnerabilities from corrupt DWARF and/or corrupt Elf. See the dwarfbug page for the details. The library now supports Elf with very large numbers of sections (which introduces an incompatibilty for the very few users calling dwarf_object_init_b() and dwarf_object_finish()). This release deletes an unnecessary and unuseable pair of functions reading the .debug_names section. Additional detail on the changes is in the Recent Changes section of libdwarf.pdf and the latest html version. 0.6.0: Date: 2023-02-20 Fixes for Denial Of Service (possible libdwarf crash): The dealloc required for dwarf_offset_list() was incorrect, possibly leading to a crash. The function prototype for dwarf_dietype_offset() changed so it can work correctly on DWARF4 objects. A memory leak from dwarf_load_loclists() has been fixed. The function dwarf_get_pubtypes() changed, Dwarf_Type no longer exists, correcting a library design mistake made in 1993. And the set of functions using Dwarf_Type are gone, use Dwarf_Global instead. An object with DW_FORM_strx3 (DWARF5) could result in the library either crashing or returning an inappropriate error. DW_FORM_strx3 is now handled properly. 0.5.0: Date: 2022-11-22 The handling of the .debug_abbrev data in libdwarf is now more cpu-efficient (measurably faster) so access to DIEs and attribute lists is faster. Corrects CU and TU indexes in the .debug_names section to be zero based as it is required to be. dwarf_get_globals() now returns a list of Dwarf_Global names and DIE offsets whether such are defined in the .debug_names or .debug_pubnames section or both. A new function, dwarf_global_tag_number(), returns the DW_TAG of any Dwarf_Global that was derived from the .debug_names section. Three new functions enable printing of the .debug_addr table. dwarf_debug_addr_table(), dwarf_debug_addr_by_index(), and dwarf_dealloc_debug_addr_table(). 0.4.2: 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). 0.4.1: 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). 0.4.0: 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.
libdwarf: update to 0.3.4.
2021-07-15:
libdwarf, dwarfdump, etc all now use a semantic version
number rather than a date string. As of today the
current version is "0.1.1".
2021-02-15:
dwarfdump given -ku now prints brief lists counting
the uses of every TAG, ATtribute, and FORM,
a concise summary of the basic building blocks of DWARF.
2021-01-23:
dwarfdump now reports and checks-for-sensible-values
the expression block offsets that DW_OP_bra and
DW_OP_skip use. If an expression does not use either of
those operators dwarfdump does not report the individual DW_OP
expression offsets.
2020-12-23:
dwarfdump --print-macinfo now follows DW_MACRO_imports
and does several additional checks on .debug_macro section
data. --check-macros skips printing most entries but does
all that and reports even more about that section. Since
.debug_macro does not reproduce all macro operations in
the original source the MACRONOTEs printed are indications
of things to consider, not errors.
2020-11-21:
dwarfdump now prints DWARF expression operators each on
its own line. This makes viewing DWARF expressions much
nicer given the increased use of much longer expressions.
Those expression operators that reference DIES are now
followed, verified, and the target DW_TAG and DW_AT_name
are printed. A new dwarfdump.conf command 'option:' lets
one specify option: --format-expr-ops-joined in case you
want the old style DWARF expression operators-on-one-line.
Where the DWARF DIE children nest > nine-deep dwarfdump
switches from indentation by spaces to a nest-level number.
2020-09-08:
libdwarf/dwarfdump work well with DWARF4 and DWARF5,
including DWP files.
2020-07-08:
libdwarf now reads .debug_gnu_pubtypes & pubnames
(non-standard but gcc creates them in DWARF5) via a small
number of new functions and dwarfdump --print-debug-gnu
prints both sections. Verifying the .debug_info offsets
is not yet done.
2020-06-29:
Dwarfdump now dumps DWARF5 .debug_rnglists and
.debug_loclists. To handle DWARF5 there are a small
number of new functions. All existing functions are
still supported, but to read DWARF5 some small changes
are required. In libdwarf see libdwarf2.1.pdf and also
see libdwarf/ChangeLog for details.
2020-05-23:
dwarfdump now takes much less malloc() to work, as
measured by valgrind --tool=massif and massif-visualizer.
A dwarfdump run that did 2.2Gib of malloc/free before the
changes now does 1.4GiB.
2020-05-19:
libdwarf and dwarfdump now support DWARF5 .debug_rnglists.
The new interfaces are documented in libdwarf/libdwarf2.1.pdf.
The new option to dwarfdump is "--print-raw-rnglists".
2019-11-04:
The code (dwarfdump/libdwarf), regressiontests,
and readelfobj directories and all their tests
are known to work on Linux(Ubuntu on x86_64 and i686),
FreeBSD, MacOS Catalina (with Apple Command Line Tools),
and IBM s390 (Big Endian!) running Ubuntu Linux.
On Windows-MinGW the full regression tests
have not been tested, but 'make check' works
for dwarfdump/libdwarf (the current dwarfdump
make check actually does run dwarfdump and
checks that dwarfdump basically works).
2019-04-16:
Now a --disable-libelf configure/build of libdwarf/dwarfdump
can read elf, mach-o DSYM, and PE executable/dll object files.
Such a build will not need or use libelf or elf.h .
The dwarfdump options that display Elf section headers
or relocation record data are not available in a
--disable-libelf build.
Nor is dwarfdump's support of reading archive files
available in a --disable-libelf build.
This libdwarf detects corrupt Elf object files much sooner
than before, but does not explain what the corruption
really is. Use GNU readelf (or readelfobj, a project
on sourceforge) to get more detail about the problems found.
See https://www.prevanders.net/dwarf.html for the git clone
command for readelfobj.
With --disable-libelf the --enable-dwarfgen option
does not work: the dwarfgen build will fail.
2019-02-18:
For building on machines without a usable elf.h or libelf
but possibly with a libelf.h visible, --disable-libelf
ensures the build won't use libelf or elf.h anywhere.
-lz will be done if zlib.h is visible, independent of
libelf, libelf.h, and elf.h
2019-02-08:
If one has a standard Bourne shell (sh) available
(such as sh on MacOS and sh in MinGW on Windows)
one may be able to build libdwarf and dwarfdump natively
and they can read Mach-o dSYM and PE object files
to access DWARF information.
This has NOT been tested under MacOS, so will likely
fail on MacOS.
No elf.h, libelf.h or zlib.h should be present.
For example, the following
is known to work under MinGW and this general plan
applies to all builds including all builds with elf.h
and libelf:
mkdir test
cd test
#(copy the source tree into test, if from git
#the name of the top level will likely be 'code')
cd code
sh -x scripts/FIX-CONFIGURE-TIMES
cd ..
mkdir bld
cd bld
../code/configure (choose your preferred options here)
make
2019-01-15:
The pre-build dwarf_names.[hc] and the tag related
files are now part of the standard build so there is
no longer any two-stage aspect of the build.
The build simply compiles files in the distribution.
If you use git to access the source be sure to
sh scripts/FIX-CONFIGURE-TIMES
to adjust the file timestamps as having timestamps
in the right relationships is vital and git
does not maintain timestamps.
The script is always safe to run. It takes about 30 seconds.
2018-12-22:
The complicated process of building certain .c and .h
files has been relegated to the few people updating
files libdwarf/libdwarf.h.in, libdwarf/dwarf_errmsg_list.h,
dwarfdump/tag_attr_ext.list,dwarfdump/tag_attr.list,
dwarfdump/tag_tree_ext.list, and dwarfdump/tag_tree.list.
For everyone else the build is simply compiling
the .c and .h files in the distribution. Simpler.
sh scripts/buildstandardsource.sh
creates these files.
2018-10-22:
dwarfdump can now dump mach-o (MacOS) dSYM dwarf.
All the usual libdwarf interfaces work.
A new libdwarf initialization call dwarf_init_path()
may be convenient for you to use.
2018-08-05:
dwarfdump.conf is now installed by make install
in <install prefix>/shared/libdwarf/dwarfdump .
Any dwarfdump.conf or .dwarfdump.conf in your
$HOME directory will be found before the
one in shared. The file is only opened when
one wants a more accurate register naming in frame
reports (the default is just to name things r54
etc, choosing the right abi with -x abi=<something>
can be helpful at times).
2018-06-24:
The configure has been completely rewritten to follow
current standards and practices. For simple builds
the standard
./configure
make
works as always, but the generated libdwarf.a appears
in libdwarf/.libs/libdwarf.a , as does the shared object
if "./configure --enable-shared" is used.
To build dwarfgen one adds the configure option --enable-dwarfgen
instead of using 'make all'.
To build the example code one adds the configure option
--enable-dwarfexample instead of using 'make all'.
"mkdir /tmp/bld ; cd /tmp/bld ; <sourcebase>/configure"
continues to work, as does configure --host=<name> .
2018-06-14:
A small simplification of build options simplifies building
across different environments. If your environment needs
to use the non-standard elf_open() call instead of unix/linux open()
then do <path>/configure --enable-elf-open which sets
HAVE_ELF_OPEN in config.h.
2018-03-27:
All the DWARF5 FORMs appear to be dealt with.
It's now possible to cross-compile libdwarf and dwarfdump.
See the README.
2016-11-30:
An alternative build mechanism using cmake is now in the source tree.
The builds for product testing continue to be done using configure && make.
Update 20160115 to 20161124 This includes security fixes. Upstream changelog ================== libdwarf-20161124 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. libdwarf-20161021 Fixes one place where erroenous dwarf not caught, Updates version strings, adds a bit more DWARF5 support, and converts the few Python scripts from python2 to python3. libdwarf-20161001 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. libdwarf-20160929 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. libdwarf-20160923 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. libdwarf-20160613 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. libdwarf-20160507 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.
Import libdwarf-20160115 as devel/libdwarf Library to access the DWARF debugging file format which supports source level debugging of a number of procedural languages, such as C, C++, and Fortran. This package contains utility dwarfdump.