%{ /* deffilep.y - parser for .def files */
-/* Copyright 1995, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+/* Copyright 1995, 1997, 1998, 1999, 2000, 2001
+ Free Software Foundation, Inc.
This file is part of GNU Binutils.
static void def_import
PARAMS ((const char *, const char *, const char *, const char *, int));
static void def_library PARAMS ((const char *, int));
-static def_file_module *def_stash_module PARAMS ((def_file *, char *));
+static def_file_module *def_stash_module PARAMS ((def_file *, const char *));
static void def_name PARAMS ((const char *, int));
static void def_section PARAMS ((const char *, int));
static void def_section_alt PARAMS ((const char *, const char *));
static def_file_module *
def_stash_module (def, name)
def_file *def;
- char *name;
+ const char *name;
{
def_file_module *s;
for (s=def->modules; s; s=s->next)
if (name)
i->name = xstrdup (name);
if (module)
- i->module = def_stash_module(def, module);
+ i->module = def_stash_module (def, module);
i->ordinal = ordinal;
if (internal_name)
i->internal_name = xstrdup (internal_name);
only determine if the subsystem is console or windows in order to select
the correct entry point by default. */
+#define TARGET_IS_${EMULATION_NAME}
+
+/* Do this before including bfd.h, so we prototype the right functions. */
+#ifdef TARGET_IS_arm_epoc_pe
+#define bfd_arm_pe_allocate_interworking_sections \
+ bfd_arm_epoc_pe_allocate_interworking_sections
+#define bfd_arm_pe_get_bfd_for_interworking \
+ bfd_arm_epoc_pe_get_bfd_for_interworking
+#define bfd_arm_pe_process_before_allocation \
+ bfd_arm_epoc_pe_process_before_allocation
+#endif
+
#include "bfd.h"
#include "sysdep.h"
#include "bfdlink.h"
#include <ctype.h>
-#define TARGET_IS_${EMULATION_NAME}
-
/* Permit the emulation parameters to override the default section
alignment by setting OVERRIDE_SECTION_ALIGNMENT. FIXME: This makes
it seem that include/coff/internal.h should not define
#define PE_DEF_FILE_ALIGNMENT 0x00000200
#endif
-#ifdef TARGET_IS_arm_epoc_pe
-#define bfd_arm_pe_allocate_interworking_sections \
- bfd_arm_epoc_pe_allocate_interworking_sections
-#define bfd_arm_pe_get_bfd_for_interworking \
- bfd_arm_epoc_pe_get_bfd_for_interworking
-#define bfd_arm_pe_process_before_allocation \
- bfd_arm_epoc_pe_process_before_allocation
-#endif
-
static void gld_${EMULATION_NAME}_set_symbols PARAMS ((void));
static void gld_${EMULATION_NAME}_after_open PARAMS ((void));
static void gld_${EMULATION_NAME}_before_parse PARAMS ((void));
if (pe_dll_extra_pe_debug)
{
- printf ("arelent: %s@%#x: add=%li\n", sym->name,
- (int) rel->address, rel->addend);
+ printf ("arelent: %s@%#lx: add=%li\n", sym->name,
+ (long) rel->address, (long) rel->addend);
}
{
FIXME: This should be done via a function, rather than by
including an internal BFD header. */
- if (coff_data (output_bfd) == NULL || coff_data (output_bfd)->pe == NULL)
+ if (coff_data (output_bfd) == NULL || coff_data (output_bfd)->pe == 0)
einfo (_("%F%P: PE operations on non PE file.\n"));
pe_data (output_bfd)->pe_opthdr = pe;
static void quoteput PARAMS ((char *, FILE *, int));
static asection *quick_section PARAMS ((bfd *, const char *, int, int));
static void quick_symbol
- PARAMS ((bfd *, char *, char *, char *, asection *, int, int));
+ PARAMS ((bfd *, const char *, const char *, const char *,
+ asection *, int, int));
static void quick_reloc PARAMS ((bfd *, int, int, int));
static bfd *make_head PARAMS ((bfd *));
static bfd *make_tail PARAMS ((bfd *));
static bfd *make_one PARAMS ((def_file_export *, bfd *));
-static bfd *make_singleton_name_thunk PARAMS ((char *, bfd *));
+static bfd *make_singleton_name_thunk PARAMS ((const char *, bfd *));
static char *make_import_fixup_mark PARAMS ((arelent *));
-static bfd *make_import_fixup_entry PARAMS ((char *, char *, char *, bfd *));
+static bfd *make_import_fixup_entry
+ PARAMS ((const char *, const char *, const char *, bfd *));
static unsigned int pe_get16 PARAMS ((bfd *, int));
static unsigned int pe_get32 PARAMS ((bfd *, int));
static unsigned int pe_as32 PARAMS ((void *));
void
pe_walk_relocs_of_symbol (info, name, cb)
struct bfd_link_info *info;
- CONST char *name;
+ const char *name;
int (*cb) (arelent *, asection *);
{
bfd *b;
static void
quick_symbol (abfd, n1, n2, n3, sec, flags, addr)
bfd *abfd;
- char *n1;
- char *n2;
- char *n3;
+ const char *n1;
+ const char *n2;
+ const char *n3;
asection *sec;
int flags;
int addr;
static bfd *
make_singleton_name_thunk (import, parent)
- char *import;
+ const char *import;
bfd *parent;
{
/* Name thunks go to idata$4. */
/* We convert reloc to symbol, for later reference. */
static int counter;
static char *fixup_name = NULL;
- static unsigned int buffer_len = 0;
+ static size_t buffer_len = 0;
struct symbol_cache_entry *sym = *rel->sym_ptr_ptr;
static bfd *
make_import_fixup_entry (name, fixup_name, dll_symname,parent)
- char *name;
- char *fixup_name;
- char *dll_symname;
+ const char *name;
+ const char *fixup_name;
+ const char *dll_symname;
bfd *parent;
{
asection *id3;
char buf[300];
struct symbol_cache_entry *sym = *rel->sym_ptr_ptr;
struct bfd_link_hash_entry *name_thunk_sym;
- CONST char *name = sym->name;
+ const char *name = sym->name;
char *fixup_name = make_import_fixup_mark (rel);
sprintf (buf, U ("_nm_thnk_%s"), name);
static void
add_bfd_to_link (abfd, name, link_info)
bfd *abfd;
- CONST char *name;
+ const char *name;
struct bfd_link_info *link_info;
{
lang_input_statement_type *fake_file;
{
unsigned char b[2];
- bfd_seek (abfd, where, SEEK_SET);
- bfd_read (b, 1, 2, abfd);
+ bfd_seek (abfd, (file_ptr) where, SEEK_SET);
+ bfd_bread (b, (bfd_size_type) 2, abfd);
return b[0] + (b[1] << 8);
}
{
unsigned char b[4];
- bfd_seek (abfd, where, SEEK_SET);
- bfd_read (b, 1, 4, abfd);
+ bfd_seek (abfd, (file_ptr) where, SEEK_SET);
+ bfd_bread (b, (bfd_size_type) 4, abfd);
return b[0] + (b[1] << 8) + (b[2] << 16) + (b[3] << 24);
}
unsigned long vsize = pe_get32 (dll, secptr1 + 16);
unsigned long fptr = pe_get32 (dll, secptr1 + 20);
- bfd_seek (dll, secptr1, SEEK_SET);
- bfd_read (sname, 1, 8, dll);
+ bfd_seek (dll, (file_ptr) secptr1, SEEK_SET);
+ bfd_bread (sname, (bfd_size_type) 8, dll);
if (vaddr <= export_rva && vaddr + vsize > export_rva)
{
}
expdata = (unsigned char *) xmalloc (export_size);
- bfd_seek (dll, expptr, SEEK_SET);
- bfd_read (expdata, 1, export_size, dll);
+ bfd_seek (dll, (file_ptr) expptr, SEEK_SET);
+ bfd_bread (expdata, (bfd_size_type) export_size, dll);
erva = expdata - export_rva;
if (pe_def_file == 0)