This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[committed]: Darwin: improve error message
- From: Tristan Gingold <gingold at adacore dot com>
- To: binutils Development <binutils at sourceware dot org>
- Date: Mon, 5 Dec 2011 14:48:33 +0100
- Subject: [committed]: Darwin: improve error message
Hi,
this is a minor patch to improve some error messages:
- name of the bfd is added in the error handler call from bfd_mach_o_read_command
- FAT binary members are now named from their architecture (instead of the archive name).
Committed on trunk.
Tristan.
bfd/
2011-12-05 Tristan Gingold <gingold@adacore.com>
* mach-o.c (bfd_mach_o_read_command): Add the bfd in the error
message.
(bfd_mach_o_openr_next_archived_file): Use arch name as member name.
(bfd_mach_o_fat_extract): Ditto.
===================================================================
RCS file: /cvs/src/src/bfd/mach-o.c,v
retrieving revision 1.68
diff -c -r1.68 mach-o.c
*** mach-o.c 22 Nov 2011 10:47:50 -0000 1.68
--- mach-o.c 5 Dec 2011 13:44:12 -0000
***************
*** 2734,2741 ****
return -1;
break;
default:
! (*_bfd_error_handler) (_("unable to read unknown load command 0x%lx"),
! (unsigned long) command->type);
break;
}
--- 2734,2741 ----
return -1;
break;
default:
! (*_bfd_error_handler)(_("%B: unable to read unknown load command 0x%lx"),
! abfd, (unsigned long) command->type);
break;
}
***************
*** 3209,3230 ****
bfd_mach_o_convert_architecture (entry->cputype, entry->cpusubtype,
&arch_type, &arch_subtype);
! /* Create the member filename.
! Use FILENAME:ARCH_NAME. */
! {
! char *s = NULL;
! const char *arch_name;
! size_t arch_file_len = strlen (bfd_get_filename (archive));
!
! arch_name = bfd_printable_arch_mach (arch_type, arch_subtype);
! s = bfd_malloc (arch_file_len + 1 + strlen (arch_name) + 1);
! if (s == NULL)
! return NULL;
! memcpy (s, bfd_get_filename (archive), arch_file_len);
! s[arch_file_len] = ':';
! strcpy (s + arch_file_len + 1, arch_name);
! nbfd->filename = s;
! }
nbfd->iostream = NULL;
bfd_set_arch_mach (nbfd, arch_type, arch_subtype);
--- 3209,3217 ----
bfd_mach_o_convert_architecture (entry->cputype, entry->cpusubtype,
&arch_type, &arch_subtype);
!
! /* Create the member filename. Use ARCH_NAME. */
! nbfd->filename = bfd_printable_arch_mach (arch_type, arch_subtype);
nbfd->iostream = NULL;
bfd_set_arch_mach (nbfd, arch_type, arch_subtype);
***************
*** 3277,3283 ****
res->origin = e->offset;
! res->filename = strdup (abfd->filename);
res->iostream = NULL;
if (bfd_check_format (res, format))
--- 3264,3270 ----
res->origin = e->offset;
! res->filename = bfd_printable_arch_mach (cpu_type, cpu_subtype);
res->iostream = NULL;
if (bfd_check_format (res, format))