/* BFD back-end for ieee-695 objects.
- Copyright (C) 1990-2017 Free Software Foundation, Inc.
+ Copyright (C) 1990-2018 Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support.
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: string too long (%d chars, max 65535)"), abfd, length);
+ (_("%pB: string too long (%ld chars, max 65535)"), abfd, (long) length);
bfd_set_error (bfd_error_invalid_operation);
return FALSE;
}
/* Functions for reading from ieee files in the strange way that the
standard requires. */
-#define this_byte(ieee) *((ieee)->input_p)
+#define this_byte(ieee) *((ieee)->input_p)
#define this_byte_and_next(ieee) ((ieee)->input_p < (ieee)->end_p ? *((ieee)->input_p++) : 0)
static bfd_boolean
if (ieee->input_p + length >= ieee->end_p)
{
_bfd_error_handler (_("IEEE parser: string length: %#lx longer than buffer: %#lx"),
- length, (long) (ieee->end_p - ieee->input_p));
+ (long) length, (long) (ieee->end_p - ieee->input_p));
bfd_set_error (bfd_error_invalid_operation);
return NULL;
}
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: unrecognized symbol `%s' flags 0x%x"),
+ (_("%pB: unrecognized symbol `%s' flags 0x%x"),
abfd, bfd_asymbol_name (symbol), symbol->flags);
bfd_set_error (bfd_error_invalid_operation);
return FALSE;
default:
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: unimplemented ATI record %u for symbol %u"),
+ (_("%pB: unimplemented ATI record %u for symbol %u"),
abfd, symbol_attribute_def, symbol_name_index);
bfd_set_error (bfd_error_bad_value);
return FALSE;
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: unexpected ATN type %d in external part"),
- abfd, (int) value);
+ (_("%pB: unexpected ATN type %" PRId64 " in external part"),
+ abfd, (int64_t) value);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
default:
_bfd_error_handler
- (_("%B: unexpected type after ATN"), abfd);
+ (_("%pB: unexpected type after ATN"), abfd);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
return FALSE;
/* Fully linked IEEE-695 files tend to give every symbol
- an absolute value. Try to convert that back into a
- section relative value. FIXME: This won't always to
- the right thing. */
+ an absolute value. Try to convert that back into a
+ section relative value. FIXME: This won't always to
+ the right thing. */
if (bfd_is_abs_section (symbol->symbol.section)
&& (abfd->flags & HAS_RELOC) == 0)
{
/* Read section name, use it if non empty. */
name = read_id (&ieee->h);
+ if (name == NULL)
+ return FALSE;
if (name[0])
section->name = name;
(void) next_byte (&(ieee->h));
library = read_id (&(ieee->h));
+ if (library == NULL)
+ goto got_wrong_format_error;
if (strcmp (library, "LIBRARY") != 0)
goto got_wrong_format_error;
ieee->section_table_size = 0;
processor = ieee->mb.processor = read_id (&(ieee->h));
+ if (processor == NULL)
+ goto got_wrong_format;
if (strcmp (processor, "LIBRARY") == 0)
goto got_wrong_format;
ieee->mb.module_name = read_id (&(ieee->h));
+ if (ieee->mb.module_name == NULL)
+ goto got_wrong_format;
if (abfd->filename == (const char *) NULL)
abfd->filename = xstrdup (ieee->mb.module_name);
case '4':
if (processor[4] == '9') /* 68349 */
strcpy (family, "68030"); /* CPU030 */
- else /* 68340, 68341 */
+ else /* 68340, 68341 */
strcpy (family, "68332"); /* CPU32 and CPU32+ */
break;
}
}
else if (TOUPPER (processor[3]) == 'F') /* 68F333 */
- strcpy (family, "68332"); /* CPU32 */
+ strcpy (family, "68332"); /* CPU32 */
else if ((TOUPPER (processor[3]) == 'C') /* Embedded controllers. */
&& ((TOUPPER (processor[2]) == 'E')
|| (TOUPPER (processor[2]) == 'H')
for (s = abfd->sections; s != (asection *) NULL; s = s->next)
{
/* Skip sections that have no loadable contents (.bss,
- debugging, etc.) */
+ debugging, etc.) */
if ((s->flags & SEC_LOAD) == 0)
continue;
return FALSE;
}
/* bfd_set_section_contents has already checked that everything
- is within range. */
+ is within range. */
memcpy (section->contents + offset, location, (size_t) count);
return TRUE;
}
else
{
/* This can happen - when there are gaps in the symbols read
- from an input ieee file. */
+ from an input ieee file. */
}
}
}
}
#define ieee_find_nearest_line _bfd_nosymbols_find_nearest_line
-#define ieee_find_line _bfd_nosymbols_find_line
+#define ieee_find_line _bfd_nosymbols_find_line
#define ieee_find_inliner_info _bfd_nosymbols_find_inliner_info
static int
#define ieee_close_and_cleanup _bfd_generic_close_and_cleanup
#define ieee_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
-#define ieee_slurp_armap bfd_true
-#define ieee_slurp_extended_name_table bfd_true
+#define ieee_slurp_armap _bfd_bool_bfd_true
+#define ieee_slurp_extended_name_table _bfd_bool_bfd_true
#define ieee_construct_extended_name_table \
- ((bfd_boolean (*) \
- (bfd *, char **, bfd_size_type *, const char **)) \
- bfd_true)
+ _bfd_noarchive_construct_extended_name_table
#define ieee_truncate_arname bfd_dont_truncate_arname
-#define ieee_write_armap \
- ((bfd_boolean (*) \
- (bfd *, unsigned int, struct orl *, unsigned int, int)) \
- bfd_true)
-#define ieee_read_ar_hdr bfd_nullvoidptr
-#define ieee_write_ar_hdr ((bfd_boolean (*) (bfd *, bfd *)) bfd_false)
-#define ieee_update_armap_timestamp bfd_true
+#define ieee_write_armap _bfd_noarchive_write_armap
+#define ieee_read_ar_hdr _bfd_ptr_bfd_null_error
+#define ieee_write_ar_hdr _bfd_noarchive_write_ar_hdr
+#define ieee_update_armap_timestamp _bfd_bool_bfd_true
#define ieee_get_elt_at_index _bfd_generic_get_elt_at_index
#define ieee_get_symbol_version_string \
_bfd_nosymbols_get_symbol_version_string
-#define ieee_bfd_is_target_special_symbol \
- ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
+#define ieee_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false
#define ieee_bfd_is_local_label_name bfd_generic_is_local_label_name
#define ieee_get_lineno _bfd_nosymbols_get_lineno
#define ieee_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
_bfd_dummy_target,
},
{
- bfd_false,
+ _bfd_bool_bfd_false_error,
ieee_mkobject,
_bfd_generic_mkarchive,
- bfd_false
+ _bfd_bool_bfd_false_error
},
{
- bfd_false,
+ _bfd_bool_bfd_false_error,
ieee_write_object_contents,
_bfd_write_archive_contents,
- bfd_false,
+ _bfd_bool_bfd_false_error,
},
/* ieee_close_and_cleanup, ieee_bfd_free_cached_info, ieee_new_section_hook,