summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2008-01-22 01:56:41 +0000
committerRoland McGrath <roland@redhat.com>2008-01-22 01:56:41 +0000
commitc58110d291bbd39e416d322076dc58bddf56bcf0 (patch)
tree3de66c784a7767ece3fa01b2ad0f6403e88ec0cb
parentc0d3c265f06daa943df2c990daab1ce059749d4b (diff)
explicit merge of 'f9dc98cac1b8ccd38e7420c43dfe7551e2923aaa'elfutils-0.132
and '90e87946af64cdaa0fc75d344ca35ee2729e655d'
-rw-r--r--libcpu/ChangeLog2
-rw-r--r--libcpu/Makefile.am4
-rw-r--r--libdw/dwarf_getpubnames.c11
-rw-r--r--libdw/dwarf_siblingof.c2
-rw-r--r--src/readelf.c11
5 files changed, 15 insertions, 15 deletions
diff --git a/libcpu/ChangeLog b/libcpu/ChangeLog
index e4dd3a75..4b225af8 100644
--- a/libcpu/ChangeLog
+++ b/libcpu/ChangeLog
@@ -2,6 +2,8 @@
* i386_parse.y: Add sanity check for NMNES macro value.
* Makefile.am (i386_parse.o): Fix target in dependency rule.
+ (i386_parse.h): New target with empty commands.
+ (i386_lex.o): Depend on it in place of i386_parse.c.
2008-01-21 Ulrich Drepper <drepper@redhat.com>
diff --git a/libcpu/Makefile.am b/libcpu/Makefile.am
index e48b37f4..51817c1e 100644
--- a/libcpu/Makefile.am
+++ b/libcpu/Makefile.am
@@ -71,9 +71,11 @@ libeu = ../lib/libeu.a
i386_lex_CFLAGS = -Wno-unused-label -Wno-unused-function -Wno-sign-compare
i386_parse.o: i386_parse.c i386.mnemonics
i386_parse_CFLAGS = -DNMNES=$$(wc -l < i386.mnemonics)
-i386_lex.o: i386_parse.c
+i386_lex.o: i386_parse.h
i386_gendis_LDADD = $(libeu) -lm $(libmudflap)
+i386_parse.h: i386_parse.c ;
+
noinst_HEADERS = memory-access.h i386_parse.h i386_data.h
EXTRA_DIST = defs/i386
diff --git a/libdw/dwarf_getpubnames.c b/libdw/dwarf_getpubnames.c
index 91dad311..08b96cdc 100644
--- a/libdw/dwarf_getpubnames.c
+++ b/libdw/dwarf_getpubnames.c
@@ -129,13 +129,10 @@ get_offsets (Dwarf *dbg)
mem[cnt].cu_offset = read_8ubyte_unaligned (dbg, readp + 2);
/* Determine the size of the CU header. */
- if (dbg->sectiondata[IDX_debug_info] == NULL
- || dbg->sectiondata[IDX_debug_info]->d_buf == NULL
- || mem[cnt].cu_offset + 3 >= dbg->sectiondata[IDX_debug_info]->d_size)
- {
- __libdw_seterrno (DWARF_E_INVALID_DWARF);
- goto err_return;
- }
+ assert (dbg->sectiondata[IDX_debug_info] != NULL);
+ assert (dbg->sectiondata[IDX_debug_info]->d_buf != NULL);
+ assert (mem[cnt].cu_offset + 3
+ < dbg->sectiondata[IDX_debug_info]->d_size);
unsigned char *infop
= ((unsigned char *) dbg->sectiondata[IDX_debug_info]->d_buf
+ mem[cnt].cu_offset);
diff --git a/libdw/dwarf_siblingof.c b/libdw/dwarf_siblingof.c
index ac9d2877..2f451d5d 100644
--- a/libdw/dwarf_siblingof.c
+++ b/libdw/dwarf_siblingof.c
@@ -56,6 +56,7 @@
#include <dwarf.h>
#include <string.h>
+
int
dwarf_siblingof (die, result)
Dwarf_Die *die;
@@ -113,6 +114,7 @@ dwarf_siblingof (die, result)
/* This abbreviation has children. */
++level;
+
while (1)
{
/* Make sure we are still in range. Some producers might skip
diff --git a/src/readelf.c b/src/readelf.c
index 2eba7e9d..90c460f9 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -4041,8 +4041,7 @@ attr_callback (Dwarf_Attribute *attrp, void *arg)
if (unlikely (dwarf_formaddr (attrp, &addr) != 0))
{
attrval_out:
- error (0, 0, gettext ("offset: %" PRIx64 " cannot get attribute value: %s"),
- attrp->valp - (unsigned char *) attrp->cu->dbg->sectiondata[IDX_debug_info]->d_buf,
+ error (0, 0, gettext ("cannot get attribute value: %s"),
dwarf_errmsg (-1));
return DWARF_CB_ABORT;
}
@@ -4286,7 +4285,7 @@ print_debug_info_section (Dwfl_Module *dwflmod,
int tag = dwarf_tag (&dies[level]);
if (unlikely (tag == DW_TAG_invalid))
{
- error (0, 0, gettext ("cannot get tag of DIE at offset %" PRIx64
+ error (0, 0, gettext ("cannot get tag of DIE at offset %" PRIu64
" in section '%s': %s"),
(uint64_t) offset, ".debug_info", dwarf_errmsg (-1));
goto do_return;
@@ -4310,10 +4309,8 @@ print_debug_info_section (Dwfl_Module *dwflmod,
if (res > 0)
{
while ((res = dwarf_siblingof (&dies[level], &dies[level])) == 1)
- {
- if (level-- == 0)
- break;
- }
+ if (level-- == 0)
+ break;
if (unlikely (res == -1))
{