commit e89c500fbbd7a54912b06fce0729367b94b52a50 Author: Mark Wielaard Date: Mon Aug 27 14:30:05 2012 +0200 readelf.c (register_info): Handle loc == NULL. register_info is called by print_cfa_program with loc being NULL. Signed-off-by: Mark Wielaard diff --git a/src/ChangeLog b/src/ChangeLog index d80f844..72804bd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2012-08-27 Mark Wielaard + + * readelf.c (register_info): Handle loc == NULL. + 2012-08-22 Jeff Kenton * elflint.c (valid_e_machine): Add EM_TILEGX and EM_TILEPRO. diff --git a/src/readelf.c b/src/readelf.c index dc49669..4ff8ebb 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -4305,9 +4305,12 @@ register_info (Ebl *ebl, unsigned int regno, const Ebl_Register_Location *loc, bits ?: &ignore, type ?: &ignore); if (n <= 0) { - snprintf (name, REGNAMESZ, "reg%u", loc->regno); + if (loc != NULL) + snprintf (name, REGNAMESZ, "reg%u", loc->regno); + else + snprintf (name, REGNAMESZ, "??? 0x%x", regno); if (bits != NULL) - *bits = loc->bits; + *bits = loc != NULL ? loc->bits : 0; if (type != NULL) *type = DW_ATE_unsigned; set = "??? unrecognized"; @@ -4315,7 +4318,7 @@ register_info (Ebl *ebl, unsigned int regno, const Ebl_Register_Location *loc, else { if (bits != NULL && *bits <= 0) - *bits = loc->bits; + *bits = loc != NULL ? loc->bits : 0; if (type != NULL && *type == DW_ATE_void) *type = DW_ATE_unsigned; commit 3e44006ae24843eff9b7248f3e250cf0fe41e7aa Author: Mark Wielaard Date: Mon Aug 27 15:21:58 2012 +0200 readelf.c (print_debug_macro_section): Print offset as PRIx64. Signed-off-by: Mark Wielaard diff --git a/src/ChangeLog b/src/ChangeLog index 72804bd..fc576fc 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,9 @@ 2012-08-27 Mark Wielaard + * readelf.c (print_debug_macro_section): Print offset as PRIx64. + +2012-08-27 Mark Wielaard + * readelf.c (register_info): Handle loc == NULL. 2012-08-22 Jeff Kenton diff --git a/src/readelf.c b/src/readelf.c index 4ff8ebb..2954e74 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -6324,8 +6324,8 @@ print_debug_macro_section (Dwfl_Module *dwflmod __attribute__ ((unused)), while (readp < readendp) { - printf (gettext (" Offset: 0x%zx\n"), - readp - (const unsigned char *) data->d_buf); + printf (gettext (" Offset: 0x%" PRIx64 "\n"), + (uint64_t) (readp - (const unsigned char *) data->d_buf)); // Header, 2 byte version, 1 byte flag, optional .debug_line offset, // optional vendor extension macro entry table.