I'm trying to debug why strip on mips isn't working properly.
What I see is that for the debug sections, sh_type is not set to
SHT_PROGBITS but to SHT_MIPS_DWARF.
The stripped file still ends up with the debug information it it,
and the file that is supposed to have the debug symbols in it
has it set to SHT_NOBITS, and is rather small.
I'm assuming this is because of the SHT_MIPS_DWARF. I'm not sure
how to find where it's going wrong.
This patch adds support for dwz multi debuginfo files to libdw.
Fedora is planning to use these in the next release:
The new DW_FORMs are proposed for DWARF5:
But are currently only a GNU extension written by the dwz tool:
libdw was already setup anticipating such a scheme, so adding support
wasn't so hard. Basically a Dwarf descriptor can now have an alternative
Dwarf descriptor that is consulted whenever one of the new DW_FROM_*alts
dwarf_begin_elf will find the right dwz alternative to use. But this is
currently tied somewhat to how fedora implemented this. There are also
two new functions dwarf_getalt () and dwarf_addalt () that can be used
to directly manipulate the alternative Dwarf descriptor. I anticipate
those will be used by some new libdwfl callbacks if we decide those are
necessary to support other ways to get/set alternative Dwarf
This is only lightly tested, but some quick stap queries on rawhide
packages that already had dwz files seemed to return the right results.
I did add some small test binary files and a readelf test to show the
results. I'll add some more tests once we decide whether this is the
proper way to support this.
Please take a look at the proposed implementation and let me know
whether it looks OK or some other approach might be better. I also
pushed this to the mjw/dwz branch.
This adds minimal low-level support for .debug_macro/DW_AT_GNU_macros as
proposed here http://www.dwarfstd.org/ShowIssue.php?issue=110722.1 and
implemented in gcc 4.7 (-g3). It is just enough to not barf on it when
we encounter the new attribute and to sanity check the attribute form
offsets. I added two small testfiles one using .debug_macinfo and one
using the new .debug_macros.
I haven't yet added the new DW_MACRO values to interpret the actual
contents. We might not even want/need to if gor higher-level support we
just reuse the DW_MACINFO values with the dwarf_getmacros (),
dwarf_macro_opcode (), dwarf_macro_param1 () and dwarf_macro_param2 ()
The new define/undef and start_file/end_file opcodes encode the same
information (and use the same values). There is no vendor_ext. There are
three new opcodes define_indirect, undef_indirect and
transparent_include. The first two are identical to define/undef, but
take their arguments differently. And transparent_include makes it
possible to reuse opcodes from somewhere else in the section. These
seems to be just the kind of thing that our interface wants to hide from
the user. So we would just return the original DW_MACINFO_define opcode
numbers and provide the param1/2 as we do now (just fetch them from
different places). Does that sound like a plan?
I'm trying to get gbd backtraces to give function names without having
a package's debuginfo installed. Would elfutils take a patch allowing
strip to take an option for keeping the minimal amount of information
needed to do this?
I'm still trying to figure out how to do this exactly but right now I
think I would be keeping SHT_SYMTAB and SHT_DYNSYM function symbols
but I haven't looked at this code before and I'm still trying to
figure out how it all comes together. Any advice would be appreciated
if you'd be okay with this functionality in elfutils.
A new release of elfutils is available now at:
* NEWS *
libelf: [g]elf[32|64]_offscn() do not match SHT_NOBITS sections at OFFSET.
libdw: dwarf_highpc function now handles DWARF 4 DW_AT_high_pc constant
form. Fix bug using dwarf_next_unit to iterate over .debug_types.
elflint: Now accepts gold linker produced executables.
The license is now GPLv2/LGPLv3+ for the libraries and GPLv3+
for stand-alone programs. There is now also a formal CONTRIBUTING
document describing how to submit patches.
* GIT SHORTLOG *
Kurt Roeckx (1):
run-alldts.sh: testrun ./alldts.
Mark Wielaard (19):
COPYING: Fix address. Updated version from gnulib.
libcpu Makefile.am, move %_dis.h from CLEANFILES to MAINTAINERCLEANFILES.
elf_end.c (elf_end): Call rwlock_unlock before rwlock_fini.
readelf.c (print_gdb_index_section): Accept version 6.
readelf.c: Check debug section data before trying to print abbrev or str.
elf32_offscn.c: Do not match SHT_NOBITS sections at OFFSET.
Add new run-unstrip-n.sh test for RHBZ#805447 fixed in commit 210c2f.
readelf.c (print_ops): Add missing DW_OP_GNU operands.
Removed old libdwarf test show-ciefde.
dwarf_highpc: Handle DW_AT_high_pc being a constant offset from DW_AT_low_
tests/low_high_pc.c: Allow highpc == lowpc for CU DIEs for buggy GCC.
elflint: Allow zero sized sections at (filesz) end of segment.
TESTS_ENVIRONMENT set LC_ALL and LANG to C.
Remove unused (generated) src/ylwrap file.
Remove .mtn-ignore and .cvsignore files.
Update name, license and contributor policy.
Prepare 0.153 release.
readelf.c: Cast printf PRIu/x64 arguments to uint64_t for gcc 4.7 -Wformat
tests/low_high_pc.c: Use proper inttypes in printf formats.
Roland McGrath (3):
Don't exclude sh_type >= SHT_NUM from stripping.
RHBZ#805447: Fix core file grokking for case of truncated .dynstr
elflint: Accept SHF_INFO_LINK for reloc sections.
Tom Tromey (1):
Fix bug using dwarf_next_unit to iterate over .debug_types
After some discussion with Red Hat legal and the current committers we
finally have a contributor policy in place for elfutils so Red Hat
doesn't have to hold all rights to the project. We made the following
- The official project name changed from "Red Hat elfutils" to plain
- The license for the backends and the libraries changed from GPLv2 +
exception to GPLv2/LGPLv3+. The license for the standalone tools was
upgraded from GPLv2 to GPLv3+.
- All future commits should carry a Signed-off-by line to confirm that
the contributor agrees to the project licensing rules described in the
Developer's Certificate of Origin. All authors keep their own
Below is the commit message that implements the above changes and
attached is the new CONTRIBUTING file that includes the Developer's
Certificate of Origin all contributors need to agree to by signing their
patches with a Signed-off-by line (git -s).
The changes were also merged into the portable, robustify, relocate and
dwarf branches. Please let us know if you think you spot a mistake or we
My plan is to do an elfutils 0.154 release next week with the above
changes and the accumulated fixes since 0.153 after running some tests
on various setups. Please let me know if you have any bugs that need to
be fixed before doing a release.
Author: Mark Wielaard <mjw(a)redhat.com>
Date: Tue Jun 5 17:15:16 2012 +0200
Update name, license and contributor policy.
* Change name from "Red Hat elfutils" to "elfutils".
* Update license of standalone tools and test from GPLv2 to GPLv3+.
* Change license of libraries from GPLv2+exception to GPLv2/LGPLv3+.
* Add Developer Certificate of Origin based contributor policy.
- COPYING: Upgraded from GPLv2 to GPLv3.
- CONTRIBUTING, COPYING-GPLv2, COPYING-LGPLv3: New files.
- NEWS: Added note about new contribution and license policy.
- Makefile.am: Updated to GPLv3, added new files to EXTRA_DIST.
- configure.ac: Update to GPLv3, changed AC_INIT name to 'elfutils'.
backends, lib, libasm, libcpu, libdw, libdwfl, libebl, libelf:
- All files updated to GPLv2/LGPLv3+. Except some very small files
(<5 lines) which didn't have any headers at all before, the linker
.maps files and the libcpu/defs files which only contain data and
libelf/elf.h which comes from glibc and is under LGPLv2+.
- elfutils.spec.in: Add new License: headers and new %doc files.
- Update all license headers to GPLv2/LGPLv3+ for files used by libs.
- All files updated to GPLv3+. Except for the test bz2 data files, the
linker maps and script files and some very small files (<5 lines)
that don't have any headers.
Signed-off-by: Richard Fontana <rfontana(a)redhat.com>
Signed-off-by: Mark Wielaard <mjw(a)redhat.com>
The project homepage is at https://fedorahosted.org/elfutils/
The current elfutils source code can be checked out with
git clone git://git.fedorahosted.org/git/elfutils.git
The developer mailinglist to send patches to is
Please supply patches using git format-patch or using git send-email.
Sign your work
To facilitate tracking of who did what, we've adopted a "sign-off"
procedure for patches based on the procedure used by the Linux kernel
The sign-off is a simple line at the end of the explanation for the
patch, which certifies that you wrote it or otherwise have the right
to pass it on as a patch under an appropriate license. The rules are
pretty simple: if you can certify the below:
Developer's Certificate of Origin
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me,
and I have the right to submit the contribution under each
license indicated in, or otherwise designated as being
applicable to, the file.
(b) The contribution was provided directly to me by some other
person who certified (a), and I have not modified it.
(c) I understand and agree that the project and the
contribution are public and that a record of the
contribution (including all personal information I submit
with it, including my sign-off) is maintained indefinitely
and may be redistributed.
then you just add a line saying
Signed-off-by: Random J Developer <random(a)developer.example.org>
using your real name (sorry, no pseudonyms or anonymous contributions.)
git commit --signoff will add such a Signed-off-by line by at the end of
the commit log message for you.