+2011-03-30 Catherine Moore <clm@codesourcery.com>
+
+ * addr2line.c (translate_addresses): Sign extend the pc
+ if sign_extend_vma is enabled.
+
2011-03-30 Michael Snyder <msnyder@msnyder-server.eng.vmware.com>
* readelf.c (process_gnu_liblist): Stop memory leak.
#include "libiberty.h"
#include "demangle.h"
#include "bucomm.h"
+#include "elf-bfd.h"
static bfd_boolean unwind_inlines; /* -i, unwind inlined functions. */
static bfd_boolean with_addresses; /* -a, show addresses. */
static void
translate_addresses (bfd *abfd, asection *section)
{
+ const struct elf_backend_data * bed;
+
int read_stdin = (naddr == 0);
for (;;)
pc = bfd_scan_vma (*addr++, NULL, 16);
}
+ if (bfd_get_flavour (abfd) == bfd_target_elf_flavour
+ && (bed = get_elf_backend_data (abfd)) != NULL
+ && bed->sign_extend_vma
+ && (pc & (bfd_vma) 1 << (bed->s->arch_size - 1)))
+ pc |= ((bfd_vma) -1) << bed->s->arch_size;
+
if (with_addresses)
{
printf ("0x");