aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorTristan Gingold <gingold@adacore.com>2011-12-05 13:48:54 +0000
committerTristan Gingold <gingold@adacore.com>2011-12-05 13:48:54 +0000
commitc0d9d05149c82752523ec300fce1fa6eaef80e02 (patch)
treed03f97ed1fce5df95997622eb3b2470e8788de59 /bfd
parentfbbd034ec595caf21bf441ec9778afbbbe2f57ca (diff)
downloadgdb-c0d9d05149c82752523ec300fce1fa6eaef80e02.zip
gdb-c0d9d05149c82752523ec300fce1fa6eaef80e02.tar.gz
gdb-c0d9d05149c82752523ec300fce1fa6eaef80e02.tar.bz2
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.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog7
-rw-r--r--bfd/mach-o.c23
2 files changed, 12 insertions, 18 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 77d6ad8..4b1e081 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+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.
+
2011-12-03 Alan Modra <amodra@gmail.com>
PR ld/13468
diff --git a/bfd/mach-o.c b/bfd/mach-o.c
index 96b993c..edb4c21 100644
--- a/bfd/mach-o.c
+++ b/bfd/mach-o.c
@@ -2734,8 +2734,8 @@ bfd_mach_o_read_command (bfd *abfd, bfd_mach_o_load_command *command)
return -1;
break;
default:
- (*_bfd_error_handler) (_("unable to read unknown load command 0x%lx"),
- (unsigned long) command->type);
+ (*_bfd_error_handler)(_("%B: unable to read unknown load command 0x%lx"),
+ abfd, (unsigned long) command->type);
break;
}
@@ -3209,22 +3209,9 @@ bfd_mach_o_openr_next_archived_file (bfd *archive, bfd *prev)
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;
- }
+ /* 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,7 +3264,7 @@ bfd_mach_o_fat_extract (bfd *abfd,
res->origin = e->offset;
- res->filename = strdup (abfd->filename);
+ res->filename = bfd_printable_arch_mach (cpu_type, cpu_subtype);
res->iostream = NULL;
if (bfd_check_format (res, format))