/* dlltool.c -- tool to generate stuff for PE style DLLs
- Copyright (C) 1995-2017 Free Software Foundation, Inc.
+ Copyright (C) 1995-2020 Free Software Foundation, Inc.
This file is part of GNU Binutils.
#include "bucomm.h"
#include "dlltool.h"
#include "safe-ctype.h"
+#include "coff-bfd.h"
#include <time.h>
#include <assert.h>
static const char *mname = "arm";
#endif
-#ifdef DLLTOOL_DEFAULT_ARM_EPOC
-static const char *mname = "arm-epoc";
-#endif
-
#ifdef DLLTOOL_DEFAULT_ARM_WINCE
static const char *mname = "arm-wince";
#endif
}
,
{
-#define MARM_EPOC 9
- "arm-epoc", ".byte", ".short", ".long", ".asciz", "@",
- "ldr\tip,[pc]\n\tldr\tpc,[ip]\n\t.long",
- ".global", ".space", ".align\t2",".align\t4", "",
- "epoc-pe-arm-little", bfd_arch_arm,
- arm_jtab, sizeof (arm_jtab), 8,
- 0, 0, 0, 0, 0, 0
- }
- ,
- {
-#define MARM_WINCE 10
+#define MARM_WINCE 9
"arm-wince", ".byte", ".short", ".long", ".asciz", "@",
"ldr\tip,[pc]\n\tldr\tpc,[ip]\n\t.long",
".global", ".space", ".align\t2",".align\t4", "-mapcs-32",
}
,
{
-#define MX86 11
+#define MX86 10
"i386:x86-64", ".byte", ".short", ".long", ".asciz", "#",
"jmp *", ".global", ".space", ".align\t2",".align\t4", "",
"pe-x86-64",bfd_arch_i386,
case MMCORE_LE:
case MMCORE_ELF:
case MMCORE_ELF_LE:
- case MARM_EPOC:
case MARM_WINCE:
break;
default:
case MMCORE_LE:
case MMCORE_ELF:
case MMCORE_ELF_LE:
- case MARM_EPOC:
case MARM_WINCE:
return ".rva\t";
default:
case MMCORE_LE:
case MMCORE_ELF:
case MMCORE_ELF_LE:
- case MARM_EPOC:
case MARM_WINCE:
break;
case M386:
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);
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;
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);
{
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. */
search_data.symname = "__NULL_IMPORT_DESCRIPTOR";
search_data.found = FALSE;
- bfd_init ();
+ if (bfd_init () != BFD_INIT_MAGIC)
+ fatal (_("fatal error: libbfd ABI mismatch"));
abfd = bfd_openr (identify_imp_name, 0);
if (abfd == NULL)
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);