[Patch] Add support for printing SDT elf notes.
by Mark Wielaard
Hi,
Another small addition to make it possible to print the new sdt elf
notes that are appearing in more and more binaries these days. The
format is fairly simple to parse and has been added to the appropriate
libebl functions. ebl_object_note_type_name () has been changed to also
take the name of the note as argument, to facilitate printing the type
depending on name.
libebl/
* libebl.h (ebl_object_note_type_name): Add const char *name arg.
* eblhooks.h (object_note_type_name): Likewise.
* eblopenbackend.c (default_object_note_type_name): Likewise.
* eblobjnotetypename.c (ebl_object_note_type_name): Likewise.
And print version if name is "stapsdt".
* eblobjnote.c (ebl_object_note): Add output for "stapsdt" notes.
src/
* readelf.c (handle_notes_data): Call ebl_object_note_type_name
with note name.
Sample output of readelf -n:
Note section [35] '.note.stapsdt' of 708 bytes at offset 0x1c0:
Owner Data size Type
stapsdt 51 Version: 3
PC: 0x2f690, Base: 0x158368, Semaphore: 0
Provider: libc, Name: setjmp, Args: '4@%eax -4@4+4(%esp) 4@%ecx'
stapsdt 44 Version: 3
PC: 0x2f730, Base: 0x158368, Semaphore: 0
Provider: libc, Name: setjmp, Args: '4@%eax -4@$1 4@%ecx'
stapsdt 44 Version: 3
PC: 0x2f772, Base: 0x158368, Semaphore: 0
Provider: libc, Name: setjmp, Args: '4@%edx -4@$0 4@%ecx'
stapsdt 50 Version: 3
PC: 0x2f80e, Base: 0x158368, Semaphore: 0
Provider: libc, Name: longjmp, Args: '4@%eax -4@8(%esp) 4@%edx'
stapsdt 57 Version: 3
PC: 0x2f81a, Base: 0x158368, Semaphore: 0
Provider: libc, Name: longjmp_target, Args: '4@%eax -4@8(%esp) 4@%edx'
stapsdt 51 Version: 3
[...]
Please let me know if you see any issues with the implementation before
I commit it. Patch attached and on the mjw/sdt git branch.
Thanks,
Mark
12 years, 7 months
[patch] Add printing of .gdb_index section to readelf
by Mark Wielaard
Hi,
In Fedora 15 debuginfo files have a new section .gdb_index.
This patch adds support for printing it out with readelf.
2011-04-14 Mark Wielaard <mjw(a)redhat.com>
* readelf.c (options): Add gdb_index.
(section_e): Define section_gdb_index.
(parse_opt): Recognize gdb_index debug-dump argument.
(print_gdb_index_section): New function.
(print_debug): Add gdb_index to debug_sections.
Sample output looks like:
GDB section [34] '.gdb_index' at offset 0x722c contains 9235 bytes :
Version: 4
CU offset: 0x18
TU offset: 0x58
address offset: 0x58
symbol offset: 0xbc
constant offset: 0x20bc
CU list at offset 0x18 contains 4 entries:
[ 0] start: 00000000, length: 5022
[ 1] start: 0x00139e, length: 3166
[ 2] start: 0x001ffc, length: 1320
[ 3] start: 0x002524, length: 1529
TU list at offset 0x58 contains 0 entries:
Address list at offset 0x58 contains 5 entries:
[ 0] 0x0000000008048ad0 <main>..0x0000000008048d94 <main+0x2c4>, CU index: 0
[ 1] 0x0000000008048e50 <create_regexp>..0x0000000008049ad8 <jargrep+0x998>, CU index: 0
[ 2] 0x0000000008049ae0 <report_str_error>..0x000000000804a9fa <inflate_string+0x25a>, CU index: 1
[ 3] 0x000000000804aa10 <pb_init>..0x000000000804ac29 <pb_read+0x149>, CU index: 2
[ 4] 0x000000000804ac30 <shift_up>..0x000000000804aff3 <shift_down+0x1f3>, CU index: 3
Symbol table at offset 0x58 contains 1024 slots:
[ 2] symbol: free_func, CUs: 1
[ 5] symbol: size_t, CUs: 0
[ 9] symbol: option, CUs: 0
[ 12] symbol: compress_file, CUs: 1
[ 42] symbol: pb_read, CUs: 2
[ 52] symbol: short unsigned int, CUs: 0
[ 68] symbol: unsigned char, CUs: 0
[ 78] symbol: _IO_FILE, CUs: 0
[...]
Does this look OK to add?
Patch attached and on the mjw/gdb_index git branch.
Thanks,
Mark
12 years, 7 months
[PATCH] Fix whitespaces
by Marek Polacek
I've found a few whitespaces nits in the *.c and *.h files. I've fixed
them. I intentionally didn't make any ChangeLog entries, since there
are no code changes. Ok?
Signed-off-by: Marek Polacek <mpolacek(a)redhat.com>
---
backends/arm_corenote.c | 2 +-
backends/i386_corenote.c | 2 +-
backends/ia64_retval.c | 2 +-
backends/ppc_corenote.c | 10 +++++-----
backends/sh_corenote.c | 2 +-
backends/sparc_corenote.c | 10 +++++-----
backends/x86_64_corenote.c | 2 +-
lib/md5.c | 2 +-
libdw/dwarf_aggregate_size.c | 2 +-
libdw/dwarf_getscopes.c | 2 +-
libdw/libdwP.h | 2 +-
libdw/memory-access.h | 2 +-
libdwfl/derelocate.c | 2 +-
libelf/elf.h | 2 +-
src/objdump.c | 6 +++---
src/readelf.c | 2 +-
src/unstrip.c | 2 +-
tests/get-lines.c | 2 +-
tests/show-abbrev.c | 2 +-
19 files changed, 29 insertions(+), 29 deletions(-)
diff --git a/backends/arm_corenote.c b/backends/arm_corenote.c
index 6f2d3a3..c26d020 100644
--- a/backends/arm_corenote.c
+++ b/backends/arm_corenote.c
@@ -48,7 +48,7 @@ static const Ebl_Register_Location prstatus_regs[] =
{ \
.name = "orig_r0", .type = ELF_T_SWORD, .format = 'd', \
.offset = offsetof (struct EBLHOOK(prstatus), pr_reg) + (4 * 17), \
- .group = "register" \
+ .group = "register" \
}
static const Ebl_Register_Location fpregset_regs[] =
diff --git a/backends/i386_corenote.c b/backends/i386_corenote.c
index 40b6a24..754a976 100644
--- a/backends/i386_corenote.c
+++ b/backends/i386_corenote.c
@@ -82,7 +82,7 @@ static const Ebl_Register_Location prstatus_regs[] =
{ \
.name = "orig_eax", .type = ELF_T_SWORD, .format = 'd', \
.offset = offsetof (struct EBLHOOK(prstatus), pr_reg) + (4 * 11), \
- .group = "register" \
+ .group = "register" \
}
static const Ebl_Register_Location fpregset_regs[] =
diff --git a/backends/ia64_retval.c b/backends/ia64_retval.c
index 7645c3c..ce836a8 100644
--- a/backends/ia64_retval.c
+++ b/backends/ia64_retval.c
@@ -46,7 +46,7 @@ static const Dwarf_Op loc_intreg[] =
#define nloc_intregs(n) (2 * (n))
/* f8, or aggregate up to f8-f15. */
-#define DEFINE_FPREG(size) \
+#define DEFINE_FPREG(size) \
static const Dwarf_Op loc_fpreg_##size[] = \
{ \
{ .atom = DW_OP_regx, .number = 128 + 8 }, \
diff --git a/backends/ppc_corenote.c b/backends/ppc_corenote.c
index af0c46a..de74406 100644
--- a/backends/ppc_corenote.c
+++ b/backends/ppc_corenote.c
@@ -34,10 +34,10 @@
#include <sys/time.h>
#ifndef BITS
-# define BITS 32
+# define BITS 32
# define BACKEND ppc_
#else
-# define BITS 64
+# define BITS 64
# define BACKEND ppc64_
#endif
#include "libebl_CPU.h"
@@ -120,12 +120,12 @@ static const Ebl_Register_Location spe_regs[] =
{ \
.name = "nip", .type = ELF_T_ADDR, .format = 'x', \
.offset = offsetof (struct EBLHOOK(prstatus), pr_reg[32]), \
- .group = "register" \
- }, \
+ .group = "register" \
+ }, \
{ \
.name = "orig_gpr3", .type = TYPE_LONG, .format = 'd', \
.offset = offsetof (struct EBLHOOK(prstatus), pr_reg[34]), \
- .group = "register" \
+ .group = "register" \
}
#include "linux-core-note.c"
diff --git a/backends/sh_corenote.c b/backends/sh_corenote.c
index 80bcd6f..6f0c1e9 100644
--- a/backends/sh_corenote.c
+++ b/backends/sh_corenote.c
@@ -70,7 +70,7 @@ static const Ebl_Register_Location prstatus_regs[] =
{ \
.name = "tra", .type = ELF_T_ADDR, .format = 'x', \
.offset = offsetof (struct EBLHOOK(prstatus), pr_reg[22]), \
- .group = "register" \
+ .group = "register" \
}
static const Ebl_Register_Location fpregset_regs[] =
diff --git a/backends/sparc_corenote.c b/backends/sparc_corenote.c
index 55aed8f..fcba1d6 100644
--- a/backends/sparc_corenote.c
+++ b/backends/sparc_corenote.c
@@ -34,10 +34,10 @@
#include <sys/time.h>
#ifndef BITS
-# define BITS 32
+# define BITS 32
# define BACKEND sparc_
#else
-# define BITS 64
+# define BITS 64
# define BACKEND sparc64_
#endif
#include "libebl_CPU.h"
@@ -65,14 +65,14 @@ static const Ebl_Register_Location fpregset_regs[] =
{
#if BITS == 32
GR (0, 32, 32), /* %f0-%f31 */
- /* padding word */
+ /* padding word */
GR (33, 1, 70), /* %fsr */
- /* qcnt, q_entrysize, en, q, padding */
+ /* qcnt, q_entrysize, en, q, padding */
# define FPREGSET_SIZE (34 * 4 + 4 + 64 * 4 + 4)
#else
GR (0, 32, 32), /* %f0-%f31 */
GR (32, 1, 83), /* %fsr */
- /* 33, 1, %gsr */
+ /* 33, 1, %gsr */
GR (34, 1, 84), /* %fprs */
# define FPREGSET_SIZE (35 * 8)
#endif
diff --git a/backends/x86_64_corenote.c b/backends/x86_64_corenote.c
index 552ac88..35f533e 100644
--- a/backends/x86_64_corenote.c
+++ b/backends/x86_64_corenote.c
@@ -91,7 +91,7 @@ static const Ebl_Register_Location prstatus_regs[] =
{ \
.name = "orig_rax", .type = ELF_T_SXWORD, .format = 'd', \
.offset = offsetof (struct EBLHOOK(prstatus), pr_reg) + (8 * 15), \
- .group = "register" \
+ .group = "register" \
}
static const Ebl_Register_Location fpregset_regs[] =
diff --git a/lib/md5.c b/lib/md5.c
index 0770561..4494a53 100644
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -369,7 +369,7 @@ md5_process_block (buffer, len, ctx)
argument specifying the function to use. */
#undef OP
#define OP(f, a, b, c, d, k, s, T) \
- do \
+ do \
{ \
a += f (b, c, d) + correct_words[k] + T; \
CYCLIC (a, s); \
diff --git a/libdw/dwarf_aggregate_size.c b/libdw/dwarf_aggregate_size.c
index e742014..77d5609 100644
--- a/libdw/dwarf_aggregate_size.c
+++ b/libdw/dwarf_aggregate_size.c
@@ -192,7 +192,7 @@ array_size (Dwarf_Die *die, Dwarf_Word *size,
{
if (INTUSE(dwarf_formudata) (attr_mem, &stride) != 0)
return -1;
- if (stride % 8) /* XXX maybe compute in bits? */
+ if (stride % 8) /* XXX maybe compute in bits? */
return -1;
stride /= 8;
}
diff --git a/libdw/dwarf_getscopes.c b/libdw/dwarf_getscopes.c
index 73431ba..d44612a 100644
--- a/libdw/dwarf_getscopes.c
+++ b/libdw/dwarf_getscopes.c
@@ -91,7 +91,7 @@ pc_match (unsigned int depth, struct Dwarf_Die_Chain *die, void *arg)
result = 0;
}
if (result == 0)
- die->prune = true;
+ die->prune = true;
if (!die->prune
&& INTUSE (dwarf_tag) (&die->die) == DW_TAG_inlined_subroutine)
diff --git a/libdw/libdwP.h b/libdw/libdwP.h
index b84bf02..5a88861 100644
--- a/libdw/libdwP.h
+++ b/libdw/libdwP.h
@@ -317,7 +317,7 @@ struct Dwarf_CU
LEN VER OFFSET ADDR
4-bytes + 2-bytes + 4-bytes + 1-byte for 32-bit dwarf
12-bytes + 2-bytes + 8-bytes + 1-byte for 64-bit dwarf
- or in .debug_types, SIGNATURE TYPE-OFFSET
+ or in .debug_types, SIGNATURE TYPE-OFFSET
4-bytes + 2-bytes + 4-bytes + 1-byte + 8-bytes + 4-bytes for 32-bit
12-bytes + 2-bytes + 8-bytes + 1-byte + 8-bytes + 8-bytes for 64-bit
diff --git a/libdw/memory-access.h b/libdw/memory-access.h
index b7799e9..5d7dc0d 100644
--- a/libdw/memory-access.h
+++ b/libdw/memory-access.h
@@ -91,7 +91,7 @@
if (likely ((__b & 0x80) == 0)) \
{ \
var = (_v << (64 - (nth * 7) - 7)) >> (64 - (nth * 7) - 7); \
- break; \
+ break; \
} \
else do {} while (0)
diff --git a/libdwfl/derelocate.c b/libdwfl/derelocate.c
index ba6d9db..d488054 100644
--- a/libdwfl/derelocate.c
+++ b/libdwfl/derelocate.c
@@ -202,7 +202,7 @@ cache_sections (Dwfl_Module *mod)
if (shdr == NULL)
goto elf_error;
- if (shdr->sh_size != 0
+ if (shdr->sh_size != 0
&& (shdr->sh_type == SHT_REL || shdr->sh_type == SHT_RELA))
{
Elf_Scn *tscn = elf_getscn (mod->main.elf, shdr->sh_info);
diff --git a/libelf/elf.h b/libelf/elf.h
index a9558a3..2a413be 100644
--- a/libelf/elf.h
+++ b/libelf/elf.h
@@ -2695,7 +2695,7 @@ typedef Elf32_Addr Elf32_Conflict;
#define R_X86_64_GOTPCREL64 28 /* 64-bit PC relative offset
to GOT entry */
#define R_X86_64_GOTPC64 29 /* 64-bit PC relative offset to GOT */
-#define R_X86_64_GOTPLT64 30 /* like GOT64, says PLT entry needed */
+#define R_X86_64_GOTPLT64 30 /* like GOT64, says PLT entry needed */
#define R_X86_64_PLTOFF64 31 /* 64-bit GOT relative offset
to PLT entry */
#define R_X86_64_SIZE32 32 /* Size of symbol plus 32-bit addend */
diff --git a/src/objdump.c b/src/objdump.c
index 1234c79..66ab445 100644
--- a/src/objdump.c
+++ b/src/objdump.c
@@ -499,7 +499,7 @@ show_relocs (Ebl *ebl, const char *fname, uint32_t shstrndx)
if (shdr->sh_type == SHT_REL || shdr->sh_type == SHT_RELA)
{
- if (! section_match (ebl->elf, elf_ndxscn (scn), shdr, shstrndx))
+ if (! section_match (ebl->elf, elf_ndxscn (scn), shdr, shstrndx))
continue;
GElf_Shdr destshdr_mem;
@@ -570,7 +570,7 @@ show_full_content (Ebl *ebl, const char *fname, uint32_t shstrndx)
if (shdr->sh_type == SHT_PROGBITS && shdr->sh_size > 0)
{
- if (! section_match (ebl->elf, elf_ndxscn (scn), shdr, shstrndx))
+ if (! section_match (ebl->elf, elf_ndxscn (scn), shdr, shstrndx))
continue;
printf (gettext ("Contents of section %s:\n"),
@@ -687,7 +687,7 @@ show_disasm (Ebl *ebl, const char *fname, uint32_t shstrndx)
if (shdr->sh_type == SHT_PROGBITS && shdr->sh_size > 0
&& (shdr->sh_flags & SHF_EXECINSTR) != 0)
{
- if (! section_match (ebl->elf, elf_ndxscn (scn), shdr, shstrndx))
+ if (! section_match (ebl->elf, elf_ndxscn (scn), shdr, shstrndx))
continue;
Elf_Data *data = elf_getdata (scn, NULL);
diff --git a/src/readelf.c b/src/readelf.c
index f2c4800..6b8b0ee 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -187,7 +187,7 @@ static enum section_e
section_pubnames = 64, /* .debug_pubnames */
section_str = 128, /* .debug_str */
section_macinfo = 256, /* .debug_macinfo */
- section_ranges = 512, /* .debug_ranges */
+ section_ranges = 512, /* .debug_ranges */
section_exception = 1024, /* .eh_frame & al. */
section_all = (section_abbrev | section_aranges | section_frame
| section_info | section_line | section_loc
diff --git a/src/unstrip.c b/src/unstrip.c
index 3283d73..59b58ce 100644
--- a/src/unstrip.c
+++ b/src/unstrip.c
@@ -242,7 +242,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
#define ELF_CHECK(call, msg) \
do \
{ \
- if (!(call)) \
+ if (!(call)) \
error (EXIT_FAILURE, 0, msg, elf_errmsg (-1)); \
} while (0)
diff --git a/tests/get-lines.c b/tests/get-lines.c
index 45d2c8d..8865461 100644
--- a/tests/get-lines.c
+++ b/tests/get-lines.c
@@ -67,7 +67,7 @@ main (int argc, char *argv[])
/* Get the DIE for the CU. */
Dwarf_Die die;
- if (dwarf_offdie (dbg, old_cuoff + hsize, &die) == NULL)
+ if (dwarf_offdie (dbg, old_cuoff + hsize, &die) == NULL)
{
/* Something went wrong. */
printf ("%s: cannot get CU die\n", argv[cnt]);
diff --git a/tests/show-abbrev.c b/tests/show-abbrev.c
index 75fddf5..cac525f 100644
--- a/tests/show-abbrev.c
+++ b/tests/show-abbrev.c
@@ -55,7 +55,7 @@ main (int argc, char *argv[])
{
/* Get the DIE for the CU. */
Dwarf_Die die;
- if (dwarf_offdie (dbg, old_cuoff + hsize, &die) == NULL)
+ if (dwarf_offdie (dbg, old_cuoff + hsize, &die) == NULL)
/* Something went wrong. */
break;
--
1.7.3.4
12 years, 7 months
FYI: Make libdw dwarf_child () work for debug_type DIEs
by Mark Wielaard
Hi,
There was a small bug in dwarf_child () that made it fail
with .debug_type Dwarf_Dies. It contained a sanity check to see whether
we reached the end of the section early. A Dwarf_CU can come from either
the debug_info unit or a debug_type unit section. So use the correct one
for sanity checking whether we have a truncated section. Fixed as
follows:
2011-04-26 Mark Wielaard <mjw(a)redhat.com>
* dwarf_child (dwarf_child): Sanity check end of section against
cu_data () of die->cu.
Cheers,
Mark
12 years, 7 months
Changes to location reporting in dwarflint
by Petr Machata
Hi there,
a rather large patch has landed on dwarf branch. This is a summary for
those interested in writing dwarflint checks that are not me (hi Mark!)
The goal was to clean up the way we create location descriptors for
reporting (the "wheres"). Until now we used single "struct where" with
a bunch of fields: section, some addresses, and chain links. Because it
turned out that we need to pinpoint various odd messages (such as .rel*
sections, location expressions), section_id ended up holding a bunch of
values that were not debuginfo-related at all. Then there was the added
wrinkle of CU DIE being formatted differently from normal DIEs in case
of aranges. It was all a bit hacky and full of exceptions.
So this is now gone. Instead, we have a top-level abstract "class
locus" with a single interface "std::string format" and several
sub-classes that take care of details. They are all used as structures,
the abstract class is only necessary for passing generic loci references
around, and ultimately to wr_message or wr_error. But if there ever is
a need to hold a bunch of distinct loci in one array, they new'ing and
later deleting them as is usual in C++ is obviously possible.
Most formatting stayed the way it was, but DIE and abbrev loci in
particular were changed to report the attribute name as soon as it is
known. This should make citations more clear:
warning: .debug_abbrev: abbr. 0x11, attr. endianity: attribute from later DWARF version.
error: .debug_info: DIE 0x29, attr. decl_file: references .debug_line table, but CU DIE lacks DW_AT_stmt_list.
The interesting locus subclasses probably are section_locus, for forming
arbitrary section pointers, and die_locus, for forming DIE references.
die_locus can be initialized simply by debug_info_entry:
for (dwarf::debug_info_entry::children_type::const_iterator
jt = children.begin (); jt != children.end (); ++jt)
// ...
wr_message (die_locus (*jt), mc_impact_3 | mc_die_other) // ...
Other loci subclasses (e.g. arange_locus) can be extended to allow
similar initialization from high-level dwarf structures. Since they are
just a bunch of classes implementing an interface, with comparatively
little magic involved, it should be pretty straightforward.
PM
12 years, 7 months
[PATCH] doubled words
by Marek Polacek
Hi,
I've used this Jim Meyering's script (thanks!) to find doubled words:
git ls-files .|xargs perl -0777 -n \
-e 'while (/\b(then?|in|an|it|on|if|at|but|f?or|and|to)\s+\1\b/gms)' \
-e '{$n=($` =~ tr/\n/\n/ + 1); ($v=$&)=~s/\n/\\n/g; print "$ARGV:$n:$v\n"}'
Here's a patch that fixes all these occurrences. Ok to apply?
Signed-off-by: Marek Polacek <mpolacek(a)redhat.com>
---
libebl/ChangeLog | 4 ++++
libebl/eblrelativerelocp.c | 2 +-
libelf/ChangeLog | 4 ++++
libelf/libelfP.h | 2 +-
src/ChangeLog | 7 +++++++
src/arlib.c | 2 +-
src/elf32-i386.script | 2 +-
src/ld.c | 2 +-
src/ldgeneric.c | 2 +-
9 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/libebl/ChangeLog b/libebl/ChangeLog
index 97315f0..56c5d04 100644
--- a/libebl/ChangeLog
+++ b/libebl/ChangeLog
@@ -1,3 +1,7 @@
+2011-04-15 Marek Polacek <mpolacek(a)redhat.com>
+
+ * eblrelativerelocp.c: Fix doubled word.
+
2011-03-21 Marek Polacek <mpolacek(a)redhat.com>
* ebldynamictagname.c: Fix typo in TLSDESC_GOT.
diff --git a/libebl/eblrelativerelocp.c b/libebl/eblrelativerelocp.c
index 8ea97b8..9c28b59 100644
--- a/libebl/eblrelativerelocp.c
+++ b/libebl/eblrelativerelocp.c
@@ -1,4 +1,4 @@
-/* Check whether given relocation is a relocation relocation.
+/* Check whether given relocation is a relative relocation.
Copyright (C) 2006 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper(a)redhat.com>, 2006.
diff --git a/libelf/ChangeLog b/libelf/ChangeLog
index d88e2fe..3176648 100644
--- a/libelf/ChangeLog
+++ b/libelf/ChangeLog
@@ -1,3 +1,7 @@
+2011-04-15 Marek Polacek <mpolacek(a)redhat.com>
+
+ * libelfP.h: Fix doubled word.
+
2011-01-05 Jan Kratochvil <jan.kratochvil(a)redhat.com>
* elf_getdata_rawchunk.c (elf_getdata_rawchunk): Fix off64_t overflow
diff --git a/libelf/libelfP.h b/libelf/libelfP.h
index 2b8391b..8f2f33a 100644
--- a/libelf/libelfP.h
+++ b/libelf/libelfP.h
@@ -251,7 +251,7 @@ struct Elf_Scn
char *rawdata_base; /* The unmodified data of the section. */
char *data_base; /* The converted data of the section. */
- struct Elf_ScnList *list; /* Pointer the the section list element the
+ struct Elf_ScnList *list; /* Pointer to the section list element the
data is in. */
};
diff --git a/src/ChangeLog b/src/ChangeLog
index 956cce2..031d009 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
+2011-04-15 Marek Polacek <mpolacek(a)redhat.com>
+
+ * ar.c (arlib_init): Fix doubled word.
+ * elf32-i386.script: Likewise.
+ * ld.c (create_lscript_symbols): Likewise.
+ * ldgeneric.c (ld_generic_create_outfile): Likewise.
+
2011-03-24 Petr Machata <pmachata(a)redhat.com>
* readelf.c (print_debug_line_section): Emit initial space for all
diff --git a/src/arlib.c b/src/arlib.c
index af98454..c69a138 100644
--- a/src/arlib.c
+++ b/src/arlib.c
@@ -61,7 +61,7 @@ arlib_init (void)
/* Using snprintf here has a problem: the call always wants to add a
NUL byte. We could use a trick whereby we specify the target
buffer size longer than it is and this would not actually fail,
- since all the fields are consecutive and we fill them in in
+ since all the fields are consecutive and we fill them in
sequence (i.e., the NUL byte gets overwritten). But
_FORTIFY_SOURCE=2 would not let us play these games. Therefore
we play it safe. */
diff --git a/src/elf32-i386.script b/src/elf32-i386.script
index a6cfffa..2083278 100644
--- a/src/elf32-i386.script
+++ b/src/elf32-i386.script
@@ -120,7 +120,7 @@ SEGMENT [RW]
is in. */
KEEP (*crtbegin.o(.ctors))
/* We don't want to include the .ctor section from
- from the crtend.o file until after the sorted ctors.
+ the crtend.o file until after the sorted ctors.
The .ctor section from the crtend file contains the
end of ctors marker and it must be last */
KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
diff --git a/src/ld.c b/src/ld.c
index 932496e..a3b0934 100644
--- a/src/ld.c
+++ b/src/ld.c
@@ -1465,7 +1465,7 @@ static void
create_lscript_symbols (void)
{
/* Walk through the data from the linker script and generate all the
- symbols which are required to be present and and those marked
+ symbols which are required to be present and those marked
with PROVIDE if there is a undefined reference. */
if (ld_state.output_segments == NULL)
return;
diff --git a/src/ldgeneric.c b/src/ldgeneric.c
index d51b54f..50f9c04 100644
--- a/src/ldgeneric.c
+++ b/src/ldgeneric.c
@@ -5856,7 +5856,7 @@ section index too large in dynamic symbol table"));
- it is not externally visible (internal, hidden)
- if export_all_dynamic is not set and is only defined in
the executable (i.e., it is defined, but not (also) in
- in DSO)
+ DSO)
Set symstrent[cnt] to NULL in case an entry is ignored. */
if (XELF_ST_TYPE (sym->st_info) == STT_FILE
--
1.7.3.4
12 years, 7 months
[dwarflint] Default to 16 dups
by Mark Wielaard
Hi Petr,
Since we still have a lot of warnings/errors by default and most of them
are duplicated a lot of times for larger object it makes sense to me to
default the printing of duplicate messages to something like 16. The
attached patch does this. Do you think this is a good idea?
Thanks,
Mark
12 years, 7 months
dwarflint: some new die_checks
by Mark Wielaard
Hi,
To get better feeling for how well line info is represented in dwarf. I
wrote two more die_checks. One to check that DW_AT_decl/call file, line
and column come in understandable pairs. That only found issues
in some test files, but none in practice with modern gcc. And another
that checks that all start addresses of code block dies are also
mentioned in the line info table. That one does produce some real
warnings. Spot checking reveals these are also the addresses at which
gdb gets somewhat confused at which source line the code really is.
I also added a small addition to dwarf::attribute_type. find_integrate
is something I keep writing myself each time. I didn't happen to use
them in these particular new tests, but I do use it during debugging
(for example to get at the name of a die construct). And it seemed
useful in general.
Cheers,
Mark
commit 849c6da0eeb1b453c7bb7ffea25a16c78d7e0a1b
Author: Mark Wielaard <mjw(a)redhat.com>
Date: Wed Apr 13 12:33:29 2011 +0200
dwarflint: new check_die_line_info die check.
Check that each code block start address is also mentioned in the
line table.
commit d7c3ae057ab527750d172173b8d2a8639be6e823
Author: Mark Wielaard <mjw(a)redhat.com>
Date: Wed Apr 13 12:26:44 2011 +0200
dwarflint: new check_die_decl_call.cc die_check.
Check that each decl or call attribute come in file/line and
column/line pairs.
commit 1f282b3fd8fcde13ba8acf21aca9e40e4328c222
Author: Mark Wielaard <mjw(a)redhat.com>
Date: Tue Apr 12 15:01:02 2011 +0200
Add elfutils::dwarf::attribute_type::find_integrate ().
Same as find (), but if the attribute name isn't found,
but there is is an abstract_origin or specification
attribute, then will try to find_integrate () the name
from that reference.
check_linkage_external_die.is_external () now uses it.
12 years, 7 months
FYI: Small build fix for unusual configuration
by Mark Wielaard
Hi,
I pushed a small build fix for the case where we are build on a system
that hasn't (or has explicitly disabled) all compression libraries. In
that case vmlinux_suffixes would be empty and the compiler would brek
with -Werror because we did comparisons against a size_t and a zero
sized array.
2011-04-11 Mark Wielaard <mjw(a)redhat.com>
* linux-kernel-modules.c (vmlinux_suffixes): Guard definition
by check for zlib, bzlib or lzma defines to check it isn't empty.
(try_kernel_name): Use same guard for use of vmlinux_suffixes.
Cheers,
Mark
commit dbb490fad0fb4924e7cd0ae3991dec1cda0de644
Author: Mark Wielaard <mjw(a)redhat.com>
Date: Mon Apr 11 17:24:16 2011 +0200
Fix libdwfl compile issue in case none of the compression libraries are there.
* linux-kernel-modules.c (vmlinux_suffixes): Guard definition
by check for zlib, bzlib or lzma defines to check it isn't empty.
(try_kernel_name): Use same guard for use of vmlinux_suffixes.
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
index 3edc11b..abad77b 100644
--- a/libdwfl/ChangeLog
+++ b/libdwfl/ChangeLog
@@ -1,3 +1,9 @@
+2011-04-11 Mark Wielaard <mjw(a)redhat.com>
+
+ * linux-kernel-modules.c (vmlinux_suffixes): Guard definition
+ by check for zlib, bzlib or lzma defines to check it isn't empty.
+ (try_kernel_name): Use same guard for use of vmlinux_suffixes.
+
2011-03-08 Roland McGrath <roland(a)redhat.com>
* dwfl_module_getdwarf.c (open_elf): Clear errno before CBFAIL.
diff --git a/libdwfl/linux-kernel-modules.c b/libdwfl/linux-kernel-modules.c
index f3d9af1..ae74a49 100644
--- a/libdwfl/linux-kernel-modules.c
+++ b/libdwfl/linux-kernel-modules.c
@@ -78,6 +78,7 @@
#define MODULE_SECT_NAME_LEN 32 /* Minimum any linux/module.h has had. */
+#if defined (USE_ZLIB) || defined (USE_BZLIB) || defined (USE_LZMA)
static const char *vmlinux_suffixes[] =
{
#ifdef USE_ZLIB
@@ -90,6 +91,7 @@ static const char *vmlinux_suffixes[] =
".xz",
#endif
};
+#endif
/* Try to open the given file as it is or under the debuginfo directory. */
static int
@@ -127,6 +129,7 @@ try_kernel_name (Dwfl *dwfl, char **fname, bool try_debug)
}
}
+#if defined (USE_ZLIB) || defined (USE_BZLIB) || defined (USE_LZMA)
if (fd < 0)
for (size_t i = 0;
i < sizeof vmlinux_suffixes / sizeof vmlinux_suffixes[0];
@@ -145,6 +148,7 @@ try_kernel_name (Dwfl *dwfl, char **fname, bool try_debug)
}
}
}
+#endif
if (fd < 0)
{
12 years, 7 months
[dwarflint] asserts with check_debug_info
by Mark Wielaard
Hi Petr,
check_debug_info can trigger an assert, which isn't a really nice way to
report an unexpected form for an attribute in the abbrev. The issue is
that read_die_chain () calls dwarf_version::form_class () a couple of
times without first validating the form via form_allowed (). Which is
understandable because this is a low level check and form_allowed () for
higher level checks to use. But... form_class will assert () if the form
isn't allowed/expected. This produces hard the debug "error reports"
when an attribute is encountered in an unforeseen form.
I fixed it by letting form_class () return max_dw_class, like
ambiguous_class () does. max_dw_class is already used as sentinel in
read_die_chain () in case the attribute is unknown. This lets things
work out for the low level check_debug_info check and then makes the
higher-level checks complain about the unexpected form instead.
Does this (patch attached) look like a sane solution to you?
Thanks,
Mark
12 years, 7 months