Strip on mips
by Kurt Roeckx
Hi,
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.
Kurt
10 years, 5 months
RFC: Handling dwz multi debuginfo files
by Mark Wielaard
Hi,
This patch adds support for dwz multi debuginfo files to libdw.
Fedora is planning to use these in the next release:
https://fedoraproject.org/wiki/Features/DwarfCompressor
The new DW_FORMs are proposed for DWARF5:
http://www.dwarfstd.org/ShowIssue.php?issue=120604.1
But are currently only a GNU extension written by the dwz tool:
http://sourceware.org/git/?p=dwz.git;a=summary
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
is seen.
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
descriptors.
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.
Thanks,
Mark
10 years, 7 months
FYI: readelf.c (print_ops): Add missing DW_OP_GNU operands.
by Mark Wielaard
Pushed the following commit as obvious.
commit 716486d5a15bdfb528c5d011dc623fa0f6fdc2af
Author: Mark Wielaard <mjw(a)redhat.com>
Date: Tue Apr 24 11:56:42 2012 +0200
readelf.c (print_ops): Add missing DW_OP_GNU operands.
DW_OP_GNU_push_tls_address, DW_OP_GNU_uinit and DW_OP_GNU_encoded_addr.
diff --git a/src/ChangeLog b/src/ChangeLog
index 642df1b..cae5e6b 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2012-04-24 Mark Wielaard <mjw(a)redhat.com>
+
+ * readelf.c (print_ops): Add DW_OP_GNU_push_tls_address,
+ DW_OP_GNU_uinit and DW_OP_GNU_encoded_addr.
+
2012-03-28 Roland McGrath <roland(a)hack.frob.com>
* elflint.c (special_sections): Accept SHF_INFO_LINK for reloc sections.
diff --git a/src/readelf.c b/src/readelf.c
index b70779d..b4e9fc8 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -4065,6 +4065,9 @@ print_ops (Dwfl_Module *dwflmod, Dwarf *dbg, int indent, int indentrest,
[DW_OP_bit_piece] = "bit_piece",
[DW_OP_implicit_value] = "implicit_value",
[DW_OP_stack_value] = "stack_value",
+ [DW_OP_GNU_push_tls_address] = "GNU_push_tls_address",
+ [DW_OP_GNU_uninit] = "GNU_uninit",
+ [DW_OP_GNU_encoded_addr] = "GNU_encoded_addr",
[DW_OP_GNU_implicit_pointer] = "GNU_implicit_pointer",
[DW_OP_GNU_entry_value] = "GNU_entry_value",
[DW_OP_GNU_const_type] = "GNU_const_type",
10 years, 8 months
Recognize .debug_macro/DW_AT_GNU_macros
by Mark Wielaard
Hi,
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 ()
interface.
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?
Cheers,
Mark
10 years, 8 months
[PATCH] tests: only compile test programs when running test
by Mike Frysinger
There's no real point in compiling all the test related binaries when
people aren't running the tests. So change the PROGRAMS category from
noinst to test to speed up default `make && make install`.
If people want to run the tests, then the utilities will be compiled
automatically when they run `make check`, so the normal workflow should
be unchanged.
Signed-off-by: Mike Frysinger <vapier(a)gentoo.org>
---
tests/ChangeLog | 4 ++++
tests/Makefile.am | 26 +++++++++++++-------------
2 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 6f5e458..5790d81 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,7 @@
+2012-06-26 Mike Frysinger <vapier(a)gentoo.org>
+
+ * Makefile.am (check_PROGRAMS): Rename from noinst_PROGRAMS.
+
2012-05-07 Mark Wielaard <mjw(a)redhat.com>
* low_high_pc.c: Use proper inttypes in printf formats.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index ced7831..8e41bc9 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -40,17 +40,17 @@ else
tests_rpath = no
endif
-noinst_PROGRAMS = arextract arsymtest newfile saridx scnnames sectiondump \
- showptable update1 update2 update3 update4 test-nlist \
- show-die-info get-files get-lines get-pubnames \
- get-aranges allfcts line2addr addrscopes funcscopes \
- show-abbrev hash newscn ecp dwflmodtest \
- find-prologues funcretval allregs rdwrmmap \
- dwfl-bug-addr-overflow arls dwfl-bug-fd-leak \
- dwfl-addr-sect dwfl-bug-report early-offscn \
- dwfl-bug-getmodules dwarf-getmacros addrcfi \
- test-flag-nobits dwarf-getstring rerequest_tag \
- alldts md5-sha1-test typeiter low_high_pc
+check_PROGRAMS = arextract arsymtest newfile saridx scnnames sectiondump \
+ showptable update1 update2 update3 update4 test-nlist \
+ show-die-info get-files get-lines get-pubnames \
+ get-aranges allfcts line2addr addrscopes funcscopes \
+ show-abbrev hash newscn ecp dwflmodtest \
+ find-prologues funcretval allregs rdwrmmap \
+ dwfl-bug-addr-overflow arls dwfl-bug-fd-leak \
+ dwfl-addr-sect dwfl-bug-report early-offscn \
+ dwfl-bug-getmodules dwarf-getmacros addrcfi \
+ test-flag-nobits dwarf-getstring rerequest_tag \
+ alldts md5-sha1-test typeiter low_high_pc
asm_TESTS = asm-tst1 asm-tst2 asm-tst3 asm-tst4 asm-tst5 \
asm-tst6 asm-tst7 asm-tst8 asm-tst9
@@ -82,12 +82,12 @@ TESTS = run-arextract.sh run-arsymtest.sh newfile test-nlist \
run-readelf-d.sh run-unstrip-n.sh run-low_high_pc.sh
if !STANDALONE
-noinst_PROGRAMS += msg_tst md5-sha1-test
+check_PROGRAMS += msg_tst md5-sha1-test
TESTS += msg_tst md5-sha1-test
endif
if HAVE_LIBASM
-noinst_PROGRAMS += $(asm_TESTS)
+check_PROGRAMS += $(asm_TESTS)
TESTS += $(asm_TESTS)
endif
--
1.7.9.7
10 years, 8 months
[PATCH] add a dummy rule for %_dis.h when maintainer mode is disabled
by Mike Frysinger
This prints a helpful error message so people know how to quickly recover
rather than the obtuse:
make[2]: *** No rule to make target `i386_dis.h', needed by `i386_disasm.o'. Stop.
Signed-off-by: Mike Frysinger <vapier(a)gentoo.org>
---
libcpu/ChangeLog | 4 ++++
libcpu/Makefile.am | 3 +++
2 files changed, 7 insertions(+)
diff --git a/libcpu/ChangeLog b/libcpu/ChangeLog
index ef9e7e5..199a349 100644
--- a/libcpu/ChangeLog
+++ b/libcpu/ChangeLog
@@ -1,3 +1,7 @@
+2012-06-26 Mike Frysinger <vapier(a)gentoo.org>
+
+ * Makefile.am [!MAINTAINER_MODE] ($(srcdir)/%_dis.h): Add dummy rule.
+
2012-02-24 Mark Wielaard <mjw(a)redhat.com>
* Makefile.am (CLEANFILES): Move %_dis.h to...
diff --git a/libcpu/Makefile.am b/libcpu/Makefile.am
index c1facd7..03064ea 100644
--- a/libcpu/Makefile.am
+++ b/libcpu/Makefile.am
@@ -55,6 +55,9 @@ noinst_PROGRAMS = i386_gendis
$(srcdir)/%_dis.h: %_defs i386_gendis
./i386_gendis $< > $@
+else
+$(srcdir)/%_dis.h:
+ @printf "\nERROR: you need to re-run configure with --enable-maintainer-mode to generate $@\n\n"; false
endif
%.mnemonics: %_defs
--
1.7.9.7
10 years, 9 months
[PATCH] ignore a few more files
by Mike Frysinger
Signed-off-by: Mike Frysinger <vapier(a)gentoo.org>
---
.gitignore | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/.gitignore b/.gitignore
index 6cfcc7c..f1cb20e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,6 +9,7 @@
*.pot
*.rej
*.so
+*.so.[0-9]
*/Makefile.in
*~
.#*
@@ -35,6 +36,30 @@ configure
elfutils.spec
libcpu/*_dis.h
libdw/known-dwarf.h
+po/POTFILES
po/en(a)boldquot.po
+po/en(a)boldquot.insert-header
po/en(a)quot.po
+po/en(a)quot.insert-header
+po/stamp-po
+po/remove-potcdate.sed
+src/addr2line
+src/ar
+src/elfcmp
+src/elflint
+src/findtextrel
+src/ld
+src/ldlex.c
+src/ldscript.c
+src/ldscript.h
+src/make-debug-archive
+src/nm
+src/objdump
+src/ranlib
+src/readelf
+src/size
+src/strings
+src/strip
+src/unstrip
stamp-h1
+/version.h
--
1.7.9.7
10 years, 9 months
Function symbol retention after stripping
by Douglas, William
Hi all,
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.
Thanks,
William
10 years, 9 months
elfutils 0.154 released
by Mark Wielaard
A new release of elfutils is available now at:
https://fedorahosted.org/releases/e/l/elfutils/0.154/
* NEWS *
Version 0.154
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
10 years, 9 months
patches welcome
by Mark Wielaard
Hi all,
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
changes:
- The official project name changed from "Red Hat elfutils" to plain
"elfutils".
- 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
copyright.
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
missed something.
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.
Thanks,
Mark
commit de2ed97f33139af5c7a0811e4ec66fc896a13cf2
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.
top-level:
- 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+.
config:
- elfutils.spec.in: Add new License: headers and new %doc files.
- Update all license headers to GPLv2/LGPLv3+ for files used by libs.
src, tests:
- 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
elfutils-devel(a)lists.fedorahosted.org.
https://fedorahosted.org/mailman/listinfo/elfutils-devel
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
project.
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.
10 years, 9 months