X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=binutils%2Fdlltool.c;h=d22ff54e098a19551ebab7ba8e2a02cf18002c00;hb=5b860c93e3c659625d92a2d2247712a84eac1041;hp=cd2ff24325d94851b1b04289067dde4a214f085c;hpb=827041555ac443bd57340060f3e034fd7b199dd8;p=deliverable%2Fbinutils-gdb.git diff --git a/binutils/dlltool.c b/binutils/dlltool.c index cd2ff24325..d22ff54e09 100644 --- a/binutils/dlltool.c +++ b/binutils/dlltool.c @@ -1,5 +1,5 @@ /* dlltool.c -- tool to generate stuff for PE style DLLs - Copyright (C) 1995-2019 Free Software Foundation, Inc. + Copyright (C) 1995-2020 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -240,6 +240,7 @@ #include "bucomm.h" #include "dlltool.h" #include "safe-ctype.h" +#include "coff-bfd.h" #include #include @@ -1252,8 +1253,7 @@ def_import (const char *app_name, const char *module, const char *dllext, append_import (application_name, module, ord_val, its_name); - if (buf) - free (buf); + free (buf); } void @@ -1334,7 +1334,7 @@ run (const char *what, char *args) pid = pexecute (argv[0], (char * const *) argv, program_name, temp_base, &errmsg_fmt, &errmsg_arg, PEXECUTE_ONE | PEXECUTE_SEARCH); - free(argv); + free (argv); if (pid == -1) { @@ -1384,7 +1384,7 @@ scan_drectve_symbols (bfd *abfd) if (s == NULL) return; - size = bfd_get_section_size (s); + size = bfd_section_size (s); buf = xmalloc (size); bfd_get_section_contents (abfd, s, buf, 0, size); @@ -2482,11 +2482,9 @@ make_one_lib_file (export_type *exp, int i, int delay) if (si->id != i) abort (); si->sec = bfd_make_section_old_way (abfd, si->name); - bfd_set_section_flags (abfd, - si->sec, - si->flags & applicable); + bfd_set_section_flags (si->sec, si->flags & applicable); - bfd_set_section_alignment(abfd, si->sec, si->align); + bfd_set_section_alignment (si->sec, si->align); si->sec->output_section = si->sec; si->sym = bfd_make_empty_symbol(abfd); si->sym->name = si->sec->name; @@ -2822,7 +2820,7 @@ make_one_lib_file (export_type *exp, int i, int delay) arelent *imglue, *ba_rel, *ea_rel, *pea_rel; /* Alignment must be set to 2**2 or you get extra stuff. */ - bfd_set_section_alignment(abfd, sec, 2); + bfd_set_section_alignment (sec, 2); si->size = 4 * 5; si->data = xmalloc (si->size); @@ -2908,8 +2906,8 @@ make_one_lib_file (export_type *exp, int i, int delay) { sinfo *si = secdata + i; - bfd_set_section_size (abfd, si->sec, si->size); - bfd_set_section_vma (abfd, si->sec, vma); + bfd_set_section_size (si->sec, si->size); + bfd_set_section_vma (si->sec, vma); } } /* Write them out. */ @@ -3389,15 +3387,8 @@ dll_name_list_free_contents (dll_name_list_node_type * entry) if (entry) { if (entry->next) - { - dll_name_list_free_contents (entry->next); - entry->next = NULL; - } - if (entry->dllname) - { - free (entry->dllname); - entry->dllname = NULL; - } + dll_name_list_free_contents (entry->next); + free (entry->dllname); free (entry); } } @@ -3691,7 +3682,7 @@ identify_search_section (bfd * abfd, asection * section, void * obj) if (ms_style && ((section->flags & SEC_DATA) == 0)) return; - if ((datasize = bfd_section_size (abfd, section)) == 0) + if ((datasize = bfd_section_size (section)) == 0) return; data = (bfd_byte *) xmalloc (datasize + 1);