Chapter 6. dwz
dwz is a command line tool that attempts to optimize DWARF debugging information contained in ELF shared libraries and ELF executables for size. To do so,
dwz replaces DWARF information representation with equivalent smaller representation where possible and reduces the amount of duplication by using techniques from Appendix E of the DWARF Standard.
Red Hat Developer Toolset is distributed with dwz 0.12.
6.1. Installing dwz
In Red Hat Developer Toolset, the
dwz utility is provided by the devtoolset-7-dwz package and is automatically installed with devtoolset-7-toolchain as described in Section 1.5, “Installing Red Hat Developer Toolset”.
6.2. Using dwz
To optimize DWARF debugging information in a binary file, run the
dwz tool as follows:
$ scl enable devtoolset-7 'dwz option... file_name'
Note that you can execute any command using the
scl utility, causing it to be run with the Red Hat Developer Toolset binaries used in preference to the Red Hat Enterprise Linux system equivalent. This allows you to run a shell session with Red Hat Developer Toolset
dwz as default:
scl enable devtoolset-7 'bash'
To verify the version of
dwz you are using at any point:
Red Hat Developer Toolset’s
dwz executable path will begin with
/opt. Alternatively, you can use the following command to confirm that the version number matches that for Red Hat Developer Toolset
6.3. Additional Resources
A detailed description of dwz and its features is beyond the scope of this book. For more information, see the resources listed below.
dwz(1) — The manual page for the
dwzutility provides detailed information on its usage. To display the manual page for the version included in Red Hat Developer Toolset:
scl enable devtoolset-7 'man dwz'
- Chapter 1, Red Hat Developer Toolset — An overview of Red Hat Developer Toolset and more information on how to install it on your system.
- Chapter 2, GNU Compiler Collection (GCC) — Instructions on compiling programs written in C, C++, and Fortran.
- Chapter 4, binutils — Instructions on using binutils, a collection of binary tools to inspect and manipulate object files and binaries.
- Chapter 5, elfutils — Instructions on using elfutils, a collection of binary tools to inspect and manipulate ELF files.