Don't forget to add test files/wrappers to EXTRA_DIST
by Mark Wielaard
Hi,
Please don't forget to add new test files and/or shell wrappers to
tests/Makefile.am EXTRA_DIST. Otherwise they will not get into a release
tar ball created with make dist.
I added the missing ones with the attached patch.
Cheers,
Mark
12 years, 10 months
eu-strip --reloc-debug-sections
by Mark Wielaard
Hi,
The following patch adds a new option to eu-strip.
2011-05-23 Mark Wielaard <mjw(a)redhat.com>
* strip.c (OPT_RELOC_DEBUG): New option.
(argp_option): Add new --reloc-debug-sections option.
(main): Check new option.
(parse_opt): Likewise.
(handle_elf): Remove any relocations between debug sections
in ET_REL for the debug file when requested.
eu-strip --reloc-debug-sections is mostly for the separate debuginfo
kernel modules. Which are ET_REL files. So they have relocation
sections. These take up a lot of space for the debug sections. Which
isn't really necessary since those sections are not allocated and will
not be relinked. So you can use eu-strip --reloc-debug-sections in
combination with -f to create a separate .debug file that has all
(simple absolute) cross debug section relocations resolved.
Rebuilding kernel-debuginfo-2.6.35.13-91.fc14.x86_64 showed a nice
reduction in size.
Before: Compressed: 238 M Expanded: 1381 M
After : Compressed: 207 M Expanded: 908 M
On the mjw/reloc-debug-sections branch there are also a couple of
testcases, which make sure there is no difference in readelf -w output
with/without --reloc-debug-sections:
2011-05-23 Mark Wielaard <mjw(a)redhat.com>
* Makefile.am (TESTS): Add run-strip-reloc.sh.
(EXTRA_DIST): Add run-strip-reloc.sh, hello_i386.ko.bz2
hello_x86_64.ko.bz2 and hello_ppc64.ko.bz2
* run-strip-reloc.sh: New test.
* hello_i386.ko.bz2: New test file.
* hello_x86_64.ko.bz2: Likewise.
* hello_ppc64.ko.bz2: Likewise.
Also tested against the above rebuild kernel package with systemtap make
installcheck, which showed no difference in failures.
Please let me know about any comments on the patch before I push it.
Thanks,
Mark
12 years, 10 months
new libdwfl/core-file test
by Marek Polacek
Hi!
Here is an attempt to test the libdw/core-file.c. First of all,
it was needed to create an ET_CORE file. I did it running the
following program (and increasing the ulimit -c):
mpolacek@pdp-11 ~/wtf $ cat zz.c
extern void abort (void) __attribute__ ((__noreturn__));
int
main (void)
{
abort ();
}
The resulting coredump is now the `testfile59.bz2.'
To achieve a better coverage I've used both ELF_C_READ{,_MMAP}.
Is it OK?
2011-05-23 Marek Polacek <mpolacek(a)redhat.com>
* dwfl-core-file.c: New test.
* run-dwfl-core-file.sh: Use it.
* testfile59.bz2: New test file.
* Makefile.am (EXTRA_DIST): Add testfile59.bz2.
(TESTS, EXTRA_DIST, noinst_PROGRAMS): Add new test.
(dwfl_core_file_LDADD): New variable.
--- elfutils/tests/dwfl-core-file.c.mp 2011-05-23 21:53:09.899212741 +0200
+++ elfutils/tests/dwfl-core-file.c 2011-05-23 21:27:00.472216488 +0200
@@ -0,0 +1,99 @@
+/* Test program for dwfl core file handling.
+ Copyright (C) 2011 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+ Written by Marek Polacek <mpolacek(a)redhat.com>, 2011.
+
+ Red Hat elfutils is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by the
+ Free Software Foundation; version 2 of the License.
+
+ Red Hat elfutils is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with Red Hat elfutils; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+ Red Hat elfutils is an included package of the Open Invention Network.
+ An included package of the Open Invention Network is a package for which
+ Open Invention Network licensees cross-license their patents. No patent
+ license is granted, either expressly or impliedly, by designation as an
+ included package. Should you wish to participate in the Open Invention
+ Network licensing program, please visit www.openinventionnetwork.com
+ <http://www.openinventionnetwork.com>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <assert.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <unistd.h>
+#include ELFUTILS_HEADER(dwfl)
+
+
+int
+main (int argc, char *argv[])
+{
+ static const Dwfl_Callbacks callbacks =
+ {
+ .find_elf = dwfl_build_id_find_elf,
+ .find_debuginfo = dwfl_standard_find_debuginfo,
+ };
+
+ if (argc != 2)
+ return 1;
+
+ /* Open the file. */
+ int fd = open64 (argv[1], O_RDONLY, 0666);
+ if (fd == -1)
+ {
+ printf ("cannot open `%s': %m\n", argv[1]);
+ return 1;
+ }
+
+ /* Set the ELF version. */
+ elf_version (EV_CURRENT);
+
+ /* Create an ELF descriptor. */
+ Elf *elf = elf_begin (fd, ELF_C_READ, NULL);
+ if (elf == NULL)
+ {
+ fail:
+ printf ("cannot create ELF descriptor: %s\n", elf_errmsg (-1));
+ return 1;
+ }
+
+ /* Set up a session. */
+ Dwfl *dwfl = dwfl_begin (&callbacks);
+ if (dwfl == NULL)
+ {
+ printf ("dwfl_begin: %s", dwfl_errmsg (-1));
+ return 1;
+ }
+
+ /* Get the number of modules. */
+ int n = dwfl_core_file_report (dwfl, elf);
+ assert (n == 4);
+
+ elf_end (elf);
+
+ /* Now do the same, only mmap the ELF file, so the
+ elf->map_address is non-NULL. */
+ elf = elf_begin (fd, ELF_C_READ_MMAP, NULL);
+ if (elf == NULL)
+ goto fail;
+
+ n = dwfl_core_file_report (dwfl, elf);
+ assert (n == 4);
+
+ /* Free the resources. */
+ elf_end (elf);
+ close (fd);
+ dwfl_end (dwfl);
+
+ return 0;
+}
--- elfutils/tests/run-dwfl-core-file.sh.mp 2011-05-23 21:52:40.030218106 +0200
+++ elfutils/tests/run-dwfl-core-file.sh 2011-05-23 21:52:40.030218106 +0200
@@ -0,0 +1,32 @@
+#! /bin/sh
+# Copyright (C) 2007-2009 Red Hat, Inc.
+# This file is part of Red Hat elfutils.
+#
+# Red Hat elfutils is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by the
+# Free Software Foundation; version 2 of the License.
+#
+# Red Hat elfutils is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with Red Hat elfutils; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+#
+# Red Hat elfutils is an included package of the Open Invention Network.
+# An included package of the Open Invention Network is a package for which
+# Open Invention Network licensees cross-license their patents. No patent
+# license is granted, either expressly or impliedly, by designation as an
+# included package. Should you wish to participate in the Open Invention
+# Network licensing program, please visit www.openinventionnetwork.com
+# <http://www.openinventionnetwork.com>.
+
+. $srcdir/test-subr.sh
+
+testfiles testfile59
+
+./dwfl-core-file testfile59
+
+exit 0
--- elfutils/tests/Makefile.am.mp 2011-05-23 21:58:22.000000000 +0200
+++ elfutils/tests/Makefile.am 2011-05-23 22:40:08.762217155 +0200
@@ -58,7 +58,7 @@ noinst_PROGRAMS = arextract arsymtest ne
dwfl-addr-sect dwfl-bug-report early-offscn \
dwfl-bug-getmodules dwarf-getmacros addrcfi \
test-flag-nobits dwarf-getstring rerequest_tag \
- alldts
+ alldts dwfl-core-file
asm_TESTS = asm-tst1 asm-tst2 asm-tst3 asm-tst4 asm-tst5 \
asm-tst6 asm-tst7 asm-tst8 asm-tst9
@@ -78,7 +78,7 @@ TESTS = run-arextract.sh run-arsymtest.s
run-find-prologues.sh run-allregs.sh \
run-readelf-test1.sh run-readelf-test2.sh run-readelf-test3.sh \
run-readelf-test4.sh run-readelf-twofiles.sh \
- run-native-test.sh run-bug1-test.sh \
+ run-native-test.sh run-bug1-test.sh run-dwfl-core-file.sh \
dwfl-bug-addr-overflow run-addrname-test.sh \
dwfl-bug-fd-leak dwfl-bug-report \
run-dwfl-bug-offline-rel.sh run-dwfl-addr-sect.sh \
@@ -143,7 +143,7 @@ EXTRA_DIST = run-arextract.sh run-arsymt
testfile45.S.bz2 testfile45.expect.bz2 run-disasm-x86-64.sh \
testfile46.bz2 testfile47.bz2 testfile48.bz2 testfile48.debug.bz2 \
testfile49.bz2 testfile50.bz2 testfile51.bz2 \
- run-prelink-addr-test.sh \
+ run-prelink-addr-test.sh run-dwfl-core-file.sh \
testfile52-32.so.bz2 testfile52-32.so.debug.bz2 \
testfile52-32.prelink.so.bz2 testfile52-32.noshdrs.so.bz2 \
testfile52-64.so.bz2 testfile52-64.so.debug.bz2 \
@@ -158,7 +158,8 @@ EXTRA_DIST = run-arextract.sh run-arsymt
testfile55-32.bz2 testfile55-32.debug.bz2 \
testfile55-32.prelink.bz2 testfile55-64.bz2 \
testfile55-64.debug.bz2 testfile55-64.prelink.bz2 \
- testfile56.bz2 testfile57.bz2 testfile58.bz2
+ testfile56.bz2 testfile57.bz2 testfile58.bz2 \
+ testfile59.bz2
installed_TESTS_ENVIRONMENT = libdir=$(DESTDIR)$(libdir) \
bindir=$(DESTDIR)$(bindir) \
@@ -255,6 +256,7 @@ addrcfi_LDADD = $(libdw) $(libebl) $(lib
test_flag_nobits_LDADD = $(libelf) $(libmudflap)
rerequest_tag_LDADD = $(libdw) $(libmudflap)
alldts_LDADD = $(libebl) $(libelf) $(libmudflap)
+dwfl_core_file_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
if GCOV
check: check-am coverage
12 years, 10 months
My-first-libelf-program breaks libraries
by Daniel Drake
Hi,
I'm trying to write a program which modifies the GNU_PRELINKED elf
timestamp. It works, but not on all libraries. Here's my attempt:
http://dev.laptop.org/attachment/ticket/10898/prelink_timestamp_remover.c
It seems to break some libraries, and if I run it over the whole
system then I can't even boot or chroot in.
I narrowed it down to a simple test case which can easily be shown to
break libc, even though my understanding is that this code should do
(almost) nothing:
http://dev.laptop.org/attachment/ticket/10898/libelf_library_eater.c
$ gcc libelf_library_eater.c -lelf -o eater
$ cp /lib/libc-2.13.so .
$ ./libc-2.13.so
GNU C Library stable release version 2.13, by Roland McGrath et al.
$ ldd libc-2.13.so
/lib/ld-linux.so.2 (0x0030d000)
linux-gate.so.1 => (0x00909000)
$ ./eater libc-2.13.so
$ ./libc-2.13.so
Segmentation fault
$ ldd libc-2.13.so
statically linked
What am I missing?
Thanks,
Daniel
12 years, 10 months
elfutils buglet ...
by Linas Vepstas
Hi,
I was fiddling with elfutils and hit a trite buglet;
lib/eu-config.h defines OLD_VERSION with an equals sign in it (instead of .set)
the assembler I use has equals signs reserved for other uses (they're actually
part of the instruction set).
--linas
12 years, 10 months
New test for elf_flag{data,ehdr,elf,phdr}
by Marek Polacek
Hi,
I've tried to check these functions in just one test, since they are very
similar. Thus, I've written the `elf-flag.c' file, which tests them so they
are all 100% covered. Tested on x86_64-redhat-linux. OK?
Marek
2011-05-07 Marek Polacek <mpolacek(a)redhat.com>
* elf-flag.c: New file.
* Makefile.am (TESTS, noinst_PROGRAMS): Add it.
(elf_flag_LDADD): New variable.
Signed-off-by: Marek Polacek <mpolacek(a)redhat.com>
---
tests/Makefile.am | 5 +-
tests/elf-flag.c | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 111 insertions(+), 2 deletions(-)
create mode 100644 tests/elf-flag.c
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 35f55e3..cd4ebca 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -58,12 +58,12 @@ noinst_PROGRAMS = arextract arsymtest newfile saridx scnnames sectiondump \
dwfl-addr-sect dwfl-bug-report early-offscn \
dwfl-bug-getmodules dwarf-getmacros addrcfi \
test-flag-nobits dwarf-getstring rerequest_tag \
- alldts
+ alldts elf-flag
asm_TESTS = asm-tst1 asm-tst2 asm-tst3 asm-tst4 asm-tst5 \
asm-tst6 asm-tst7 asm-tst8 asm-tst9
TESTS = run-arextract.sh run-arsymtest.sh newfile test-nlist \
- update1 update2 update3 update4 \
+ update1 update2 update3 update4 elf-flag \
run-show-die-info.sh run-get-files.sh run-get-lines.sh \
run-get-pubnames.sh run-get-aranges.sh run-allfcts.sh \
run-show-abbrev.sh run-line2addr.sh hash \
@@ -255,6 +255,7 @@ addrcfi_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
test_flag_nobits_LDADD = $(libelf) $(libmudflap)
rerequest_tag_LDADD = $(libdw) $(libmudflap)
alldts_LDADD = $(libebl) $(libelf) $(libmudflap)
+elf_flag_LDADD = $(libelf) $(libmudflap)
if GCOV
check: check-am coverage
diff --git a/tests/elf-flag.c b/tests/elf-flag.c
new file mode 100644
index 0000000..c208238
--- /dev/null
+++ b/tests/elf-flag.c
@@ -0,0 +1,108 @@
+/* Check elf_flag{data,ehdr,elf,phdr} functions.
+ Copyright (C) 2011 Red Hat, Inc.
+ This file is part of Red Hat elfutils.
+ Written by Marek Polacek <mpolacek(a)redhat.com>, 2011.
+
+ Red Hat elfutils is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by the
+ Free Software Foundation; version 2 of the License.
+
+ Red Hat elfutils is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with Red Hat elfutils; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+ Red Hat elfutils is an included package of the Open Invention Network.
+ An included package of the Open Invention Network is a package for which
+ Open Invention Network licensees cross-license their patents. No patent
+ license is granted, either expressly or impliedly, by designation as an
+ included package. Should you wish to participate in the Open Invention
+ Network licensing program, please visit www.openinventionnetwork.com
+ <http://www.openinventionnetwork.com>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <fcntl.h>
+#include <gelf.h>
+#include <stdio.h>
+#include <stdbool.h>
+#include <unistd.h>
+#include "libelfP.h"
+
+int
+main (int argc __attribute__ ((unused)), char *argv[])
+{
+ bool result = false;
+
+ /* Open ourselves. */
+ int fd = open64 (argv[0], O_RDONLY);
+ if (fd == -1)
+ {
+ printf ("cannot open `%s': %m\n", argv[0]);
+ return 1;
+ }
+
+ /* Tell the library which version are we expecting. */
+ elf_version (EV_CURRENT);
+
+ /* Create an ELF descriptor. */
+ Elf *elf = elf_begin (fd, ELF_C_READ, NULL);
+ if (elf == NULL)
+ {
+ printf ("cannot create ELF descriptor: %s\n", elf_errmsg (-1));
+ return 1;
+ }
+
+/* Lazy bastard, eh? */
+#define TEST_FLAG(type) \
+ result |= elf_flag##type (NULL, ELF_C_SET, ELF_F_DIRTY); \
+ result |= elf_flag##type (elf, ELF_C_SET, ELF_F_DIRTY) == 0; \
+ result |= elf_flag##type (elf, ELF_C_CLR, ELF_F_DIRTY); \
+ result |= elf_flag##type (elf, ELF_C_EMPTY, ELF_F_DIRTY); \
+ elf->kind = ELF_K_COFF; \
+ result |= elf_flag##type (elf, ELF_C_SET, ELF_F_DIRTY); \
+ elf->kind = ELF_K_ELF;
+
+ /* Test the elf_flagelf. */
+ TEST_FLAG (elf);
+
+ /* Test the elf_flagehdr. */
+ TEST_FLAG (ehdr);
+
+ /* Test the elf_flagphdr. */
+ TEST_FLAG (phdr);
+
+ /* Test the elf_flagdata. */
+ Elf_Scn *scn = NULL;
+ scn = elf_nextscn (elf, scn);
+ if (scn == NULL)
+ return 1;
+
+ Elf_Data *data = elf_getdata (scn, NULL);
+ if (data == NULL)
+ return 1;
+
+ /* Try with NULL parameter. */
+ result |= elf_flagdata (NULL, ELF_C_SET, ELF_F_DIRTY);
+
+ /* Try to set a flag. */
+ result |= elf_flagdata (data, ELF_C_SET, ELF_F_DIRTY) == 0;
+
+ /* Try to clear a flag. */
+ result |= elf_flagdata (data, ELF_C_CLR, ELF_F_DIRTY) == 0;
+
+ /* Try an insane command. */
+ result |= elf_flagdata (data, ELF_C_EMPTY, ELF_F_DIRTY);
+
+ /* Set a kind that is not the ELF_K_ELF. */
+ scn->elf->kind = ELF_K_COFF;
+ result |= elf_flagdata (data, ELF_C_SET, ELF_F_DIRTY);
+
+ return result;
+}
--
1.7.3.4
12 years, 10 months
strip vs elf section groups
by Mark Wielaard
Hi,
strip had a couple of issues with elf section groups. binutils gas was
recently fixed so that section group signature symbols are actually real
symbols with names instead of naming the section after the signature and
using the section symbol (which doesn't have a name, so couldn't
technically be used as signature symbol). There was an assert in strip
that fell over the new/correct signature symbol usage. When not all
sections of a section group were removed strip still tried to remove the
section group itself. And when moving a section group to the debug file
it didn't retain the type and original section list (which gets
rewritten for the stripped file). All issues were actually detected by
elflint, so writing a test was easy. The following fixes these issues.
2011-05-18 Mark Wielaard <mjw(a)redhat.com>
* strip.c (handle_elf): Make sure all sections of a removed group
section are removed too. Don't discard SHT_GROUP sections, copy
section table before it gets modified. Section group signature
symbols don't have to be retained.
Patch attached. The git branch mjw/strip-group contains the same plus an
extra testcase for the above issues, which fails before and succeeds
after this patch. Please let me know if I missed anything important in
this fix before I push it to master.
There is still an issue with unstrip which depends on comparing section
names for unallocated sections. New binutils gas names all group
sections ".group" and unstrip would need to compare the signature symbol
names in case of a SHT_GROUP section. I have not fixed that yet.
Cheers,
Mark
12 years, 10 months
Unusual -rpath linkage for libdw.so
by Frank Ch. Eigler
Hi -
I have a question regarding commit e219f1c1b2 (by roland, from pre-git days)
that changed the way libdw/libdw.so is linked:
@@ -94,7 +93,10 @@ libdw_so_SOURCES =
libdw.so: $(srcdir)/libdw.map libdw_pic.a \
../libdwfl/libdwfl_pic.a ../libebl/libebl.a \
../libelf/libelf.so
+# The rpath is necessary for libebl because its $ORIGIN use will
+# not fly in a setuid executable that links in libdw.
$(LINK) -shared -o $@ -Wl,--soname,$@.$(VERSION),-z,defs \
+ -Wl,--enable-new-dtags,-rpath,$(pkglibdir) \
-Wl,--version-script,$<,--no-undefined \
-Wl,--whole-archive $(filter-out $<,$^) -Wl,--no-whole-archive\
-ldl
This construct conflicts with the bundled-elfutils mode of systemtap
linkage (also written by roland back in '08), where that $(pkglibdir)
is made to have build-tree paths rather than install-tree paths: (from
systemtap top-level configure.ac)
# Our libdw.so's libebl will look in $ORIGIN/../lib/... but that
# $ORIGIN is where libdw.so resides, which is not where there is a ../lib.
# Note that $libdir might be using a quoted use of $exec_prefix or $prefix.
# So we must make sure to pass those settings to elfutils configure.
elfutils_rpath="-Wl,--enable-new-dtags,-rpath,${libdir}/${PACKAGE_NAME}"
here=`pwd`
(mkdir -p build-elfutils && cd build-elfutils &&
bash ${elfutils_srcdir}/configure --enable-libebl-subdir=${PACKAGE_NAME} \
--includedir="${here}/include-elfutils" \
--libdir="${here}/lib-elfutils" \
--exec-prefix="$exec_prefix" \
--prefix="$prefix" \
CFLAGS="${CFLAGS/-Wall/} $gnu89_inline_flag" \
LDFLAGS="$LDFLAGS $elfutils_rpath" &&
This in turn propagates build-tree DT_R*PATH into the .so files.
There appear to be no tools able to remove those erroneous paths.
Is there still a need for the libdw custom rpath usage? I don't know
of any setuid users of -ldw.
- FChE
12 years, 10 months
cross-compiling elftuils fails
by Alexander Stein
Hello,
I'm trying to cross-compile elfutils for ARM. But my compilation stopped at in
libcpu. Here are the last compile messages:
arm-none-linux-gnueabi-gcc -std=gnu99 -Wall -Wshadow -Werror -Wunused -Wextra
-Wformat=2 -fpic -fdollars-in-identifiers -g -O2 -L/sysroot-target/lib -
L/sysroot-target/usr/lib -Wl,-rpath-link -Wl,/sysroot-target/lib -Wl,-rpath-
link -Wl,/sysroot-target/usr/lib -o i386_gendis i386_gendis.o i386_lex.o
i386_parse.o ../lib/libeu.a -lm
m4 -Di386 -DDISASSEMBLER defs/i386 > i386_defs
m4 -Dx86_64 -DDISASSEMBLER defs/i386 > x86_64_defs
./i386_gendis i386_defs > i386_dis.h
./i386_gendis x86_64_defs > x86_64_dis.h
/bin/sh: ./i386_gendis: cannot execute binary file
/bin/sh: ./i386_gendis: cannot execute binary file
make[3]: *** [x86_64_dis.h] Error 126
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [i386_dis.h] Error 126
It seems like a compiled (ARM) application is executed which obviously doesn't
work. What can I do here?
In the end I just need libdw.so and libelf.so for perf. Maybe it is possible
to strip down the compilation to only those two libs?
Regards,
Alexander
12 years, 10 months
Some elfutils tweaks for typed DWARF stack
by Mark Wielaard
Hi,
Here is a patch from Jakub (with some small tweaks to the output
from me). It adds typed DWARF stack support (which is now in gcc trunk)
where DW_OP_GNU_entry_value is supported. readelf -w works. For more
background on the new ops see http://www.dwarfstd.org/doc/040408.1.html
Here is some example output:
[ f582] GNU_call_site_parameter
location (block1)
[ 0] reg17
GNU_call_site_value (block1)
[ 0] breg15 0
[ 2] const1u 32
[ 4] shl
[ 5] const1u 32
[ 7] shr
[ 8] GNU_convert [ 38]
[ 10] GNU_convert [ 31]
[ 12] GNU_const_type [ 31] 8 byte block: 00 00 00 00 00 00
59 40
[ 23] mul
[ 24] fbreg -168
[ 27] GNU_deref_type 8 [ 31]
[ 30] div
We haven't figured out yet how to adjust dwarf_getlocation to handle
these 5 new ops and DW_OP_GNU_entry_value.
I'll push the first patch to master, merge master into the dwarf branch
and then apply the second patch on the branch.
Cheers,
Mark
12 years, 10 months