Eliminate make_cleanup_ui_file_delete / make ui_file a class hierarchy
[binutils-gdb.git] / bfd / pef.c
index 4e7683b63bf800aec094d0feab32af4e20a11e01..5f64d44ade07468eb45e4a33f10f73522eadd508 100644 (file)
--- a/bfd/pef.c
+++ b/bfd/pef.c
@@ -1,5 +1,5 @@
 /* PEF support for BFD.
-   Copyright (C) 1999-2015 Free Software Foundation, Inc.
+   Copyright (C) 1999-2017 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -67,6 +67,7 @@
 #define bfd_pef_bfd_final_link                      _bfd_generic_final_link
 #define bfd_pef_bfd_link_split_section              _bfd_generic_link_split_section
 #define bfd_pef_get_section_contents_in_window      _bfd_generic_get_section_contents_in_window
+#define bfd_pef_bfd_link_check_relocs               _bfd_generic_link_check_relocs
 
 static int
 bfd_pef_parse_traceback_table (bfd *abfd,
@@ -217,7 +218,7 @@ bfd_pef_print_symbol (bfd *abfd,
       fprintf (file, " %-5s %s", symbol->section->name, symbol->name);
       if (CONST_STRNEQ (symbol->name, "__traceback_"))
        {
-         unsigned char *buf = alloca (symbol->udata.i);
+         unsigned char *buf = xmalloc (symbol->udata.i);
          size_t offset = symbol->value + 4;
          size_t len = symbol->udata.i;
          int ret;
@@ -227,6 +228,7 @@ bfd_pef_print_symbol (bfd *abfd,
                                               len, 0, NULL, file);
          if (ret < 0)
            fprintf (file, " [ERROR]");
+         free (buf);
        }
     }
 }
@@ -520,8 +522,8 @@ bfd_pef_scan (bfd *abfd,
   bfd_pef_convert_architecture (header->architecture, &cputype, &cpusubtype);
   if (cputype == bfd_arch_unknown)
     {
-      (*_bfd_error_handler) (_("bfd_pef_scan: unknown architecture 0x%lx"),
-                              header->architecture);
+      _bfd_error_handler (_("bfd_pef_scan: unknown architecture 0x%lx"),
+                         header->architecture);
       return -1;
     }
   bfd_set_arch_mach (abfd, cputype, cpusubtype);