/* Support for the generic parts of COFF, for BFD.
- Copyright (C) 1990-2015 Free Software Foundation, Inc.
+ Copyright (C) 1990-2017 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
case compress:
if (!bfd_init_section_compress_status (abfd, return_section))
{
- (*_bfd_error_handler)
+ _bfd_error_handler
+ /* xgettext: c-format */
(_("%B: unable to initialize compress status for section %s"),
abfd, name);
return FALSE;
case decompress:
if (!bfd_init_section_decompress_status (abfd, return_section))
{
- (*_bfd_error_handler)
+ _bfd_error_handler
+ /* xgettext: c-format */
(_("%B: unable to initialize decompress status for section %s"),
abfd, name);
return FALSE;
coff_write_alien_symbol (bfd *abfd,
asymbol *symbol,
struct internal_syment *isym,
+ union internal_auxent *iaux,
bfd_vma *written,
bfd_size_type *string_size_p,
asection **debug_string_section_p,
debug_string_section_p, debug_string_size_p);
if (isym != NULL)
*isym = native->u.syment;
+ if (iaux != NULL && native->u.syment.n_numaux)
+ *iaux = native[1].u.auxent;
return ret;
}
}
static void
-null_error_handler (const char * fmt ATTRIBUTE_UNUSED, ...)
+null_error_handler (const char *fmt ATTRIBUTE_UNUSED,
+ va_list ap ATTRIBUTE_UNUSED)
{
}
if (c_symbol == (coff_symbol_type *) NULL
|| c_symbol->native == (combined_entry_type *) NULL)
{
- if (!coff_write_alien_symbol (abfd, symbol, NULL, &written,
+ if (!coff_write_alien_symbol (abfd, symbol, NULL, NULL, &written,
&string_size, &debug_string_section,
&debug_string_size))
return FALSE;
else if (! c_symbol->native->is_sym)
maxlen = bfd_coff_force_symnames_in_strings (abfd) ? 0 : SYMNMLEN;
-
+
else if (bfd_coff_symname_in_debug (abfd,
&c_symbol->native->u.syment))
/* This symbol name is in the XCOFF .debug section.
syms = bfd_malloc (size);
if (syms == NULL)
- return FALSE;
+ {
+ /* PR 21013: Provide an error message when the alloc fails. */
+ _bfd_error_handler (_("%B: Not enough memory to allocate space for %lu symbols"),
+ abfd, size);
+ return FALSE;
+ }
if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0
|| bfd_bread (syms, size, abfd) != size)
if (strsize < STRING_SIZE_SIZE)
{
- (*_bfd_error_handler)
+ _bfd_error_handler
+ /* xgettext: c-format */
(_("%B: bad string table size %lu"), abfd, (unsigned long) strsize);
bfd_set_error (bfd_error_bad_value);
return NULL;
if (internal == NULL && size != 0)
return NULL;
internal_end = internal + obj_raw_syment_count (abfd);
-
+
raw_src = (char *) obj_coff_external_syms (abfd);
/* Mark the end of the symbols. */
auxp->u.auxent.x_scn.x_comdat);
break;
}
- /* Otherwise fall through. */
+ /* Fall through. */
case C_EXT:
case C_AIX_WEAKEXT:
if (ISFCN (combined->u.syment.n_type))
llnos, next);
break;
}
- /* Otherwise fall through. */
+ /* Fall through. */
default:
fprintf (file, "AUX lnno %d size 0x%x tagndx %ld",
auxp->u.auxent.x_sym.x_misc.x_lnsz.x_lnno,
bias = _bfd_dwarf2_find_symbol_bias (symbols,
& coff_data (abfd)->dwarf2_find_line_info);
-
+
if (bias
&& _bfd_dwarf2_find_nearest_line (abfd, symbols, NULL, section,
offset + bias,
{
size_t size;
- if (!info->relocatable)
+ if (!bfd_link_relocatable (info))
size = bfd_coff_filhsz (abfd) + bfd_coff_aoutsz (abfd);
else
size = bfd_coff_filhsz (abfd);
fini_reloc_cookie_rels (struct coff_reloc_cookie *cookie,
asection *sec)
{
- if (cookie->rels && coff_section_data (NULL, sec)->relocs != cookie->rels)
+ if (cookie->rels
+ /* PR 20401. The relocs may not have been cached, so check first.
+ If the relocs were loaded by init_reloc_cookie_rels() then this
+ will be the case. FIXME: Would performance be improved if the
+ relocs *were* cached ? */
+ && coff_section_data (NULL, sec)
+ && coff_section_data (NULL, sec)->relocs != cookie->rels)
free (cookie->rels);
}
o->flags |= SEC_EXCLUDE;
if (info->print_gc_sections && o->size != 0)
+ /* xgettext: c-format */
_bfd_error_handler (_("Removing unused section '%s' in file '%B'"), sub, o->name);
#if 0
if (!bed->can_gc_sections
|| !is_coff_hash_table (info->hash))
{
- (*_bfd_error_handler)(_("Warning: gc-sections option ignored"));
+ _bfd_error_handler(_("Warning: gc-sections option ignored"));
return TRUE;
}
#endif