/* PEF support for BFD.
- Copyright (C) 1999-2018 Free Software Foundation, Inc.
+ Copyright (C) 1999-2019 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
#define bfd_pef_bfd_lookup_section_flags bfd_generic_lookup_section_flags
#define bfd_pef_bfd_merge_sections bfd_generic_merge_sections
#define bfd_pef_bfd_is_group_section bfd_generic_is_group_section
+#define bfd_pef_bfd_group_name bfd_generic_group_name
#define bfd_pef_bfd_discard_group bfd_generic_discard_group
#define bfd_pef_section_already_linked _bfd_generic_section_already_linked
#define bfd_pef_bfd_define_common_symbol bfd_generic_define_common_symbol
fprintf (file, " %-5s %s", symbol->section->name, symbol->name);
if (CONST_STRNEQ (symbol->name, "__traceback_"))
{
- unsigned char *buf = xmalloc (symbol->udata.i);
+ unsigned char *buf;
size_t offset = symbol->value + 4;
size_t len = symbol->udata.i;
- int ret;
- bfd_get_section_contents (abfd, symbol->section, buf, offset, len);
- ret = bfd_pef_parse_traceback_table (abfd, symbol->section, buf,
- len, 0, NULL, file);
- if (ret < 0)
+ buf = bfd_malloc (len);
+ if (buf == NULL
+ || !bfd_get_section_contents (abfd, symbol->section, buf,
+ offset, len)
+ || bfd_pef_parse_traceback_table (abfd, symbol->section, buf,
+ len, 0, NULL, file) < 0)
fprintf (file, " [ERROR]");
free (buf);
}