/* BFD back-end for PowerPC Microsoft Portable Executable files.
- Copyright (C) 1990-2017 Free Software Foundation, Inc.
+ Copyright (C) 1990-2020 Free Software Foundation, Inc.
Original version pieced together by Kim Knuttila (krk@cygnus.com)
ppc_coff_link_hash_table_create (bfd *abfd)
{
struct ppc_coff_link_hash_table *ret;
- bfd_size_type amt = sizeof (struct ppc_coff_link_hash_table);
+ size_t amt = sizeof (struct ppc_coff_link_hash_table);
ret = (struct ppc_coff_link_hash_table *) bfd_malloc (amt);
if (ret == NULL)
const char *name)
{
/* Add this entry to our toc addr-offset-name list. */
- bfd_size_type amt = sizeof (struct list_ele);
+ size_t amt = sizeof (struct list_ele);
struct list_ele *t = (struct list_ele *) bfd_malloc (amt);
if (t == NULL)
switch (r_type)
{
default:
- _bfd_error_handler
- /* xgettext: c-format */
- (_("%B: unsupported relocation type 0x%02x"), input_bfd, r_type);
+ /* xgettext: c-format */
+ _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+ input_bfd, r_type);
bfd_set_error (bfd_error_bad_value);
return FALSE;
case IMAGE_REL_PPC_TOCREL16:
{
_bfd_error_handler
/* xgettext: c-format */
- (_("%B: Relocation for %s of %#Lx exceeds "
+ (_("%pB: Relocation for %s of %#" PRIx64 " exceeds "
"Toc size limit"),
- input_bfd, name, our_toc_offset);
+ input_bfd, name, (uint64_t) our_toc_offset);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
{
_bfd_error_handler
/* xgettext: c-format */
- (_("%B: Relocation exceeds allocated TOC (%#Lx)"),
- input_bfd, toc_section->size);
+ (_("%pB: Relocation exceeds allocated TOC (%#" PRIx64 ")"),
+ input_bfd, (uint64_t) toc_section->size);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
_bfd_error_handler
/* xgettext: c-format */
- (_("Warning: unsupported reloc %s <file %B, section %A>\n"
- "sym %ld (%s), r_vaddr %Ld (%#Lx)"),
+ (_("warning: unsupported reloc %s <file %pB, section %pA>\n"
+ "sym %ld (%s), r_vaddr %" PRId64 " (%#" PRIx64 ")"),
howto->name, input_bfd, input_section,
- rel->r_symndx, my_name, rel->r_vaddr, rel->r_vaddr);
+ rel->r_symndx, my_name,
+ (int64_t) rel->r_vaddr, (uint64_t) rel->r_vaddr);
}
break;
case IMAGE_REL_PPC_IMGLUE:
_bfd_error_handler
/* xgettext: c-format */
- (_("%B: Out of order IMGLUE reloc for %s"), input_bfd, my_name);
+ (_("%pB: Out of order IMGLUE reloc for %s"), input_bfd, my_name);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
{
asection *s;
bfd_byte *foo;
- bfd_size_type amt;
static char test_char = '1';
if ( global_toc_size == 0 ) /* FIXME: does this get me in trouble? */
/* No toc section? Something is very wrong. */
abort ();
- amt = global_toc_size;
- foo = (bfd_byte *) bfd_alloc (bfd_of_toc_owner, amt);
+ foo = (bfd_byte *) bfd_alloc (bfd_of_toc_owner, global_toc_size);
memset(foo, test_char, (size_t) global_toc_size);
s->size = global_toc_size;
_bfd_stringtab_free (flaginfo.strtab);
- /* Setting bfd_get_symcount to 0 will cause write_object_contents to
+ /* Setting symcount to 0 will cause write_object_contents to
not try to write out the symbols. */
- bfd_get_symcount (abfd) = 0;
+ abfd->symcount = 0;
return TRUE;
BFD_ENDIAN_LITTLE, /* data byte order is little */
BFD_ENDIAN_LITTLE, /* header byte order is little */
- (HAS_RELOC | EXEC_P | /* FIXME: object flags */
- HAS_LINENO | HAS_DEBUG |
- HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
+ (HAS_RELOC | EXEC_P /* FIXME: object flags */
+ | HAS_LINENO | HAS_DEBUG
+ | HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
#ifndef COFF_WITH_PE
(SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_CODE | SEC_READONLY
bfd_getl32, bfd_getl_signed_32, bfd_putl32,
bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
- {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
- bfd_generic_archive_p, /* _bfd_dummy_target */ coff_object_p },
- {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
- bfd_false},
- {bfd_false, coff_write_object_contents, /* bfd_write_contents */
- _bfd_write_archive_contents, bfd_false},
+ { /* bfd_check_format */
+ _bfd_dummy_target,
+ coff_object_p,
+ bfd_generic_archive_p,
+ coff_object_p
+ },
+ { /* bfd_set_format */
+ _bfd_bool_bfd_false_error,
+ coff_mkobject,
+ _bfd_generic_mkarchive,
+ _bfd_bool_bfd_false_error
+ },
+ { /* bfd_write_contents */
+ _bfd_bool_bfd_false_error,
+ coff_write_object_contents,
+ _bfd_write_archive_contents,
+ _bfd_bool_bfd_false_error
+ },
BFD_JUMP_TABLE_GENERIC (coff),
BFD_JUMP_TABLE_COPY (coff),
/* Alternative_target. */
#ifdef TARGET_BIG_SYM
- & TARGET_BIG_SYM,
+ &TARGET_BIG_SYM,
#else
NULL,
#endif
BFD_ENDIAN_BIG, /* data byte order is big */
BFD_ENDIAN_BIG, /* header byte order is big */
- (HAS_RELOC | EXEC_P | /* FIXME: object flags */
- HAS_LINENO | HAS_DEBUG |
- HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
+ (HAS_RELOC | EXEC_P /* FIXME: object flags */
+ | HAS_LINENO | HAS_DEBUG
+ | HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
#ifndef COFF_WITH_PE
(SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_CODE | SEC_READONLY
bfd_getb32, bfd_getb_signed_32, bfd_putb32,
bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
- {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
- bfd_generic_archive_p, /* _bfd_dummy_target */ coff_object_p },
- {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
- bfd_false},
- {bfd_false, coff_write_object_contents, /* bfd_write_contents */
- _bfd_write_archive_contents, bfd_false},
+ { /* bfd_check_format */
+ _bfd_dummy_target,
+ coff_object_p,
+ bfd_generic_archive_p,
+ coff_object_p
+ },
+ { /* bfd_set_format */
+ _bfd_bool_bfd_false_error,
+ coff_mkobject,
+ _bfd_generic_mkarchive,
+ _bfd_bool_bfd_false_error
+ },
+ { /* bfd_write_contents */
+ _bfd_bool_bfd_false_error,
+ coff_write_object_contents,
+ _bfd_write_archive_contents,
+ _bfd_bool_bfd_false_error
+ },
BFD_JUMP_TABLE_GENERIC (coff),
BFD_JUMP_TABLE_COPY (coff),
/* Alternative_target. */
#ifdef TARGET_LITTLE_SYM
- & TARGET_LITTLE_SYM,
+ &TARGET_LITTLE_SYM,
#else
NULL,
#endif