Mark Wielaard | 11 May 13:08
Picon
Favicon

FYI small test environment tweak

I pushed the following:

commit dbbc67a97ace66c3adc299f26261fdec99d0c0d6
Author: Mark Wielaard <mjw <at> redhat.com>
Date:   Fri May 11 12:57:57 2012 +0200

    TESTS_ENVIRONMENT set LC_ALL and LANG to C.

    Some tests rely on sort order and output of tools that might be localized.

    Reported-by: Paweł Sikora <pluto <at> pld-linux.org>

diff --git a/tests/ChangeLog b/tests/ChangeLog
index 4c6e9f7..841742d 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,7 @@
+2012-05-11  Mark Wielaard  <mjw <at> redhat.com>
+
+       * Makefile.am (TESTS_ENVIRONMENT): Set LC_ALL and LANG to C.
+
 2012-05-07  Mark Wielaard  <mjw <at> redhat.com>

        * low_high_pc.c: Allow highpc == lowpc for CU DIEs for buggy GCC.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 61247e4..660791c 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -169,13 +169,14 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \

(Continue reading)

Douglas, William | 7 May 20:51
Picon
Favicon

Function symbol retention after stripping

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
_______________________________________________
elfutils-devel mailing list
elfutils-devel <at> lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/elfutils-devel
Mark Wielaard | 7 May 13:34
Picon
Favicon

FYI: tests/low_high_pc.c: Allow highpc == lowpc for CU DIEs for buggy GCC.

I pushed the following. Although the bug is fixed in GCC 4.7 that has
only been released last month. Most distros are still based on 4.6 or
lower.

commit d9bc75fc20f0ce5064cac192a518af3c7192e96d
Author: Mark Wielaard <mjw <at> redhat.com>
Date:   Mon May 7 13:29:52 2012 +0200

    tests/low_high_pc.c: Allow highpc == lowpc for CU DIEs for buggy GCC.

    GCC < 4.7 had a bug where no code CUs got a highpc == lowpc.
    Allow that, because it is not the main purpose of this test.

diff --git a/tests/ChangeLog b/tests/ChangeLog
index abc7340..4c6e9f7 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,7 @@
+2012-05-07  Mark Wielaard  <mjw <at> redhat.com>
+
+	* low_high_pc.c: Allow highpc == lowpc for CU DIEs for buggy GCC.
+
 2012-04-27  Mark Wielaard  <mjw <at> redhat.com>

 	* Makefile.am (TESTS): Add run-low_high_pc.sh
diff --git a/tests/low_high_pc.c b/tests/low_high_pc.c
index 3054046..6fc8b15 100644
--- a/tests/low_high_pc.c
+++ b/tests/low_high_pc.c
@@ -72,9 +72,12 @@ handle_die (Dwarf_Die *die, void *arg)
(Continue reading)

Mark Wielaard | 27 Apr 13:11
Picon
Favicon

PATCH: dwarf_highpc: Handle DW_AT_high_pc being a constant offset from DW_AT_low_pc.

Hi,

The DWARF spec says (since version 4) that DW_AT_high_pc can be
represented by a constant form.

        If the value of the DW_AT_high_pc is of class address, it is the
        relocated address of the first location past the last
        instruction associated with the entity; if it is of class
        constant, the value is an unsigned integer offset which when
        added to the low PC gives the address of the first location past
        the last instruction associated with the entity.

I have a patch for gcc to encode DW_AT_high_pc this way (which saves a
lot of relocations) and jakub has a patch for dwz to encode
DW_AT_high_pc in the smallest possible constant form, which can save ~1%
on the size of debuginfo.

The attached patch adds a testcase for this and makes dwarf_highpc ()
handle the constant form.

Does this look OK?

Thanks,

Mark
commit 0569ad3036adb5c3e61ee212674cf8d3a24749bb
Author: Mark Wielaard <mjw <at> redhat.com>
Date:   Fri Apr 27 13:00:50 2012 +0200
(Continue reading)

Mark Wielaard | 26 Apr 12:28
Picon
Favicon

FYI: Removed old libdwarf test show-ciefde.

Hi,

elfutils libdwarf was removed a long time ago and this testcase was
never actually ran anyway (which is why nobody noticed it was broken).
I just removed it.

commit bdad8e39aede889dbac95944a07eaebdebe4ad89
Author: Mark Wielaard <mjw <at> redhat.com>
Date:   Thu Apr 26 12:24:33 2012 +0200

    Removed old libdwarf test show-ciefde.

diff --git a/tests/ChangeLog b/tests/ChangeLog
index c38ede5..ffe61d5 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,9 @@
+2012-04-26  Mark Wielaard  <mjw <at> redhat.com>
+
+       * Makefile.am (EXTRA_DIST): Remove run-show-ciefde.sh.
+       * run-show-ciefde.sh: Removed old libdwarf test.
+       * show-ciefde.c: Likewise.

_______________________________________________
elfutils-devel mailing list
elfutils-devel <at> lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/elfutils-devel
Mark Wielaard | 26 Apr 11:58
Picon
Favicon

elflint: (zero sized section) alloc flag set but section not in any loaded segment

Hi,

Against development versions of gcc/binutils elflint gives some
complaints like:

section [24] '.tm_clone_table': alloc flag set but section not in any
loaded segment

This is because that section's size is zero. So it is somewhat
reasonable IMHO that the linker doesn't put it in any segment.

Is the following patch to elflint OK?

Thanks,

Mark
commit e4b786145aac6de17b84c77ddf2db40629cca9ee
Author: Mark Wielaard <mjw <at> redhat.com>
Date:   Thu Apr 26 11:45:47 2012 +0200

    elflint: Don't check zero sized sections are loaded in any segment.

diff --git a/src/ChangeLog b/src/ChangeLog
index cae5e6b..6252686 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2012-04-26  Mark Wielaard  <mjw <at> redhat.com>
(Continue reading)

Mark Wielaard | 24 Apr 12:00
Picon
Favicon

FYI: readelf.c (print_ops): Add missing DW_OP_GNU operands.

Pushed the following commit as obvious.

commit 716486d5a15bdfb528c5d011dc623fa0f6fdc2af
Author: Mark Wielaard <mjw <at> 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 <at> 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 <at> 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",
(Continue reading)

Zachary McGrew | 13 Apr 02:54
Picon

Elfutils 0.153 build problem

I'm trying (and failing) to build elfutils 0.153 on my i686 Linux box.

The lines around the error are:

gcc -std=gnu99 -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2
-g -O2   -o libdw.so -shared -o libdw.so
-Wl,--soname,libdw.so.1,-z,defs \
	-Wl,--enable-new-dtags,-rpath,/usr/lib/elfutils \
	-Wl,--version-script,libdw.map,--no-undefined \
	-Wl,--whole-archive libdw_pic.a ../libdwfl/libdwfl_pic.a
../libebl/libebl.a ../libelf/libelf.so -Wl,--no-whole-archive\
	-ldl -llzma -lbz2 -lz
if readelf -d libdw.so | fgrep -q TEXTREL; then exit 1; fi
make[1]: *** [libdw.so] Error 1

For good measure I ran "readelf -d | fgrep TEXTREL" on libdl.so,
liblzma.so, libbz2.so, and libz.so, but they all come back clean.

Running readelf -d libdw.so gets me:

Dynamic section at offset 0x49a60 contains 32 entries:
  Tag        Type                         Name/Value
 0x00000001 (NEEDED)                     Shared library: [libelf.so.1]
 0x00000001 (NEEDED)                     Shared library: [libdl.so.2]
 0x00000001 (NEEDED)                     Shared library: [liblzma.so.5]
 0x00000001 (NEEDED)                     Shared library: [libbz2.so.1.0]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x00000001 (NEEDED)                     Shared library: [ld-linux.so.2]
 0x0000000e (SONAME)                     Library soname: [libdw.so.1]
 0x0000000f (RPATH)                      Library rpath: [/usr/lib/elfutils]
(Continue reading)

Mark Wielaard | 2 Apr 17:34
Picon
Favicon

[Patch] gelf_offscn vs SHT_NOBITS

Hi,

While coming up with a test case for rhbz#807823 "elflint doesn't
recognize SHF_INFO_LINK on relocation sections", I came across another
issue. Not just with elflint, but also with readelf -d. If there is a
SHT_NOBITS section before the .dynamic section then gelf_offscn will
miss it. The solution is similar to commit e9c4e8 (Do not match empty
sections at OFFSET), skip SHT_NOBITS sections too if there is a "real"
section at the same offset that does have content. Does the solution
look sane?

The test binary is a testcase for both this issue and the original
rhbz#807823. Both tests fail before and succeed after the fixes.

Patch attached and in git on the mjw/offscn_nobits branch for those that
want to check out the test binary.

Cheers,

Mark
commit 191d1f0b9163593eee8c4f5cbe3e95cabf6ae9a9
Author: Mark Wielaard <mjw <at> redhat.com>
Date:   Mon Apr 2 17:11:25 2012 +0200

    elf32_offscn.c: Do not match SHT_NOBITS sections at OFFSET.
    
    readelf -d doesn't work if a SHT_NOBITS section is right before the actual
    .dynamic section at the same offset. elflint also fails on such binaries.
(Continue reading)

Mark Wielaard | 28 Mar 11:44
Picon
Favicon

[Patch] Don't relocate compressed sections

Hi,

As pointed out in https://bugzilla.redhat.com/show_bug.cgi?id=807053
relocating a compressed section will corrupt it. To more properly
support compressed sections we should finish the roland/relocate branch
for lazy relocations work. The best we can do for now is to not corrupt
the contents of the compressed sections and not crash when we don't have
all Dwarf debug section data. The attached two patches do that.

Cheers,

Mark
From ce12994c215b08758e5c79fcd1af8b8b3d069acc Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mjw <at> redhat.com>
Date: Wed, 28 Mar 2012 11:20:36 +0200
Subject: [PATCH 1/2] readelf.c: Check debug section data before trying to
 print abbrev or str.

	* readelf.c (print_debug_abbrev_section): Check there is Dwarf
	section data.
	(print_debug_str_section): Likewise.
---
 src/ChangeLog |    6 ++++++
 src/readelf.c |    8 ++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/ChangeLog b/src/ChangeLog
index 6281756..30be3e1 100644
(Continue reading)

Mark Wielaard | 21 Mar 16:13
Picon
Favicon

FYI: readelf.c (print_gdb_index_section): Accept version 6.

Hi,

Just applied the following to accept a newer version number
for .gdb_index in readelf. No real change in the format, the updated
version is just a marker that there are more symbols in the index
available.

Cheers,

Mark
From 30bb714e7446d35d15cd53b3c794dd8ac08d0a29 Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mjw <at> redhat.com>
Date: Wed, 21 Mar 2012 16:05:31 +0100
Subject: [PATCH] readelf.c (print_gdb_index_section): Accept version 6.

No changes in the format.  Version 6 contains symbols for inlined
functions, older versions didn't.
---
 src/ChangeLog |    4 ++++
 src/readelf.c |    5 +++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/ChangeLog b/src/ChangeLog
index ff19b48..6281756 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
+2012-03-21  Mark Wielaard  <mjw <at> redhat.com>
(Continue reading)


Gmane