-
Notifications
You must be signed in to change notification settings - Fork 568
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
i#5926 libdw: Switch drsyms to use libdw from elfutils (#6534)
Switches from elftoolchain's libdwarf, which is no longer being updated, to elfutil's libdw, only for Linux for now. The interfaces are slightly different but generally similar. We also switch to the libelf from elfutil to ensure its interactions with libdw work properly. Adds a new third_party/elfutils submodule. Adds the LGPL3 elfutils license to our license docs, stressing that we are providing drsyms as a library distinct from the rest of DR. Adds build rules to build the 4 elfutils libraries we need (libdw, libelf, plus helpers libdwelf and libebl) as static PIC libraries. As elfutils uses autoconf, we check in a config.h file from a local configure believed to be general enough for our supported toolchains to feed to our CMake build. Adds 4 patches needed for elfutils. These are stored in the parent dynamorio repository and applied at CMake configure time to create new source files in the build directory. This keeps the submodule pristine. The patches are: 1) Fix a bug in elf_memory() where an ignored "command" enum was used. 2) Shrink the stack usage of read_srclines() called by dwarf_getsrclines() to fit on DR's small stacks. 3) Redirect zlib heap allocation. 4) Pre-allocate a destination instead of realpath(xxx, NULL). Adds a requirement that zlib be available on Linux to build drysms, as elfutils requires zlib for compressed debug sections. Adds -Dmalloc=__wrap_malloc, etc. to redirect heap usage by the elfutils static libraries to DR. Adds a new tool.drcacheoff.check-malloc test to better check for malloc use in the drmemtrace client. The new test explicitly invokes drsyms via the drmemtrace function tracing feature, while disabling lz4 compression (as it turns off the import check). This test only passes with the -Dmalloc=__wrap_malloc defines and the zlib heap redirect patch. Adds a new drsyms_dw.c file, partly mirroring drsyms_dwarf.c. The libdw and libdwarf interfaces are different enough it seemed best to have a separate file, though the general code is similar. The drsyms_elf.c differences are in-file via ifdef. Removes the -gdwarf-4 workaround from the docs. Adds new -gdwarf-4 and -gdwarf-5 drsyms tests. The libelftc demangler is kept via the checked-in static library, since libdw does not have its own demangler. We do not expect this part of libelftc to need updates. Fixes #5926
- Loading branch information
1 parent
76bfa29
commit 0a6c057
Showing
25 changed files
with
1,383 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.