X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=binutils%2Fcoffdump.c;h=90ce55032e6d2e60ec871fc4428bfdf0b4077a3d;hb=8b89121d4444e5c23295c63835da538b11d4cb49;hp=b952b6204776843981485c08864397828a35d974;hpb=b90efa5b79ac1524ec260f8eb89d1be37e0219a7;p=deliverable%2Fbinutils-gdb.git diff --git a/binutils/coffdump.c b/binutils/coffdump.c index b952b62047..90ce55032e 100644 --- a/binutils/coffdump.c +++ b/binutils/coffdump.c @@ -417,21 +417,23 @@ dump_coff_sfile (struct coff_sfile *p) static void dump_coff_section (struct coff_section *ptr) { - int i; + unsigned int i; tab (1); - printf (_("section %s %d %d address %x size %x number %d nrelocs %d"), + printf (_("section %s %d %d address %x size %x number %d nrelocs %u"), ptr->name, ptr->code, ptr->data, ptr->address,ptr->size, ptr->number, ptr->nrelocs); nl (); for (i = 0; i < ptr->nrelocs; i++) { + struct coff_reloc * r = ptr->relocs + i; tab (0); printf ("(%x %s %x)", - ptr->relocs[i].offset, - ptr->relocs[i].symbol->name, - ptr->relocs[i].addend); + r->offset, + /* PR 17512: file: 0a38fb7c. */ + r->symbol == NULL ? _("") : r->symbol->name, + r->addend); nl (); } @@ -498,6 +500,7 @@ main (int ac, char **av) program_name = av[0]; xmalloc_set_program_name (program_name); + bfd_set_error_program_name (program_name); expandargv (&ac, &av); @@ -549,9 +552,11 @@ main (int ac, char **av) } tree = coff_grok (abfd); - - coff_dump (tree); - printf ("\n"); + if (tree) + { + coff_dump (tree); + printf ("\n"); + } return 0; }