aboutsummaryrefslogtreecommitdiffstats
path: root/src/readelf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/readelf.c')
-rw-r--r--src/readelf.c37
1 files changed, 29 insertions, 8 deletions
diff --git a/src/readelf.c b/src/readelf.c
index 685d0b17..64067a57 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -6045,10 +6045,16 @@ print_debug_ranges_section (Dwfl_Module *dwflmod,
if (begin == (Dwarf_Addr) -1l) /* Base address entry. */
{
- printf (gettext (" [%6tx] base address\n "), offset);
+ if (first)
+ printf (" [%6tx] ", offset);
+ else
+ printf (" ");
+ puts (gettext ("base address"));
+ printf (" ");
print_dwarf_addr (dwflmod, address_size, end, end);
printf ("\n");
base = end;
+ first = false;
}
else if (begin == 0 && end == 0) /* End of list entry. */
{
@@ -6176,7 +6182,7 @@ print_cfa_program (const unsigned char *readp, const unsigned char *const endp,
int data_align,
unsigned int version, unsigned int ptr_size,
unsigned int encoding,
- Dwfl_Module *dwflmod, Ebl *ebl, Dwarf *dbg)
+ Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr, Dwarf *dbg)
{
char regnamebuf[REGNAMESZ];
const char *regname (unsigned int regno)
@@ -6399,8 +6405,11 @@ print_cfa_program (const unsigned char *readp, const unsigned char *const endp,
printf (" MIPS_advance_loc8 %" PRIu64 " to %#" PRIx64 "\n",
op1, pc += op1 * code_align);
break;
- case DW_CFA_GNU_window_save:
- puts (" GNU_window_save");
+ case DW_CFA_GNU_window_save: /* DW_CFA_AARCH64_negate_ra_state */
+ if (ehdr->e_machine == EM_AARCH64)
+ puts (" AARCH64_negate_ra_state");
+ else
+ puts (" GNU_window_save");
break;
case DW_CFA_GNU_args_size:
if ((uint64_t) (endp - readp) < 1)
@@ -6930,7 +6939,7 @@ print_debug_frame_section (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr,
else
print_cfa_program (readp, cieend, vma_base, code_alignment_factor,
data_alignment_factor, version, ptr_size,
- fde_encoding, dwflmod, ebl, dbg);
+ fde_encoding, dwflmod, ebl, ehdr, dbg);
readp = cieend;
}
}
@@ -8642,7 +8651,7 @@ print_debug_line_section (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr,
printf (", ");
}
printf ("\n");
- if (linep >= lineendp)
+ if (linep > lineendp)
goto invalid_unit;
}
}
@@ -8685,6 +8694,12 @@ print_debug_line_section (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr,
++linep;
}
+ if (linep == lineendp)
+ {
+ puts (gettext ("\nNo line number statements."));
+ return;
+ }
+
puts (gettext ("\nLine number statements:"));
Dwarf_Word address = 0;
unsigned int op_index = 0;
@@ -9609,10 +9624,16 @@ print_debug_loc_section (Dwfl_Module *dwflmod,
if (begin == (Dwarf_Addr) -1l) /* Base address entry. */
{
- printf (gettext (" [%6tx] base address\n "), offset);
+ if (first)
+ printf (" [%6tx] ", offset);
+ else
+ printf (" ");
+ puts (gettext ("base address"));
+ printf (" ");
print_dwarf_addr (dwflmod, address_size, end, end);
printf ("\n");
base = end;
+ first = false;
}
else if (begin == 0 && end == 0) /* End of list entry. */
{
@@ -11082,7 +11103,7 @@ print_debug (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr)
};
if (dbg == NULL)
{
- if ((print_debug_sections & ~section_exception) != 0)
+ if ((print_debug_sections & ~(section_exception|section_frame)) != 0)
error (0, 0, gettext ("cannot get debug context descriptor: %s"),
dwfl_errmsg (-1));
dbg = &dummy_dbg;