static boolean pe_print_private_bfd_data PARAMS ((bfd *, PTR));
#define coff_bfd_print_private_bfd_data pe_print_private_bfd_data
-
static boolean (*pe_saved_coff_bfd_copy_private_bfd_data)
PARAMS ((bfd *, bfd *)) =
#ifndef coff_bfd_copy_private_bfd_data
correctly for a PEI file, check the e_magic number here, and, if
it doesn't match, clobber the f_magic number so that we don't get
a false match. */
+#if 0
+ /* We can't assume that the PE header is at offset 0x80. When it
+ isn't, the DOS header isn't read correctly, so we can't assume
+ e_magic is set even for valid PE files. */
if (bfd_h_get_16 (abfd, (bfd_byte *) filehdr_src->e_magic) != DOSMAGIC)
filehdr_dst->f_magic = -1;
+#endif
#endif
/* Other people's tools sometimes generate headers with an nsyms but
#define coff_swap_filehdr_out _bfd_pe_only_swap_filehdr_out
#endif
-
static void
coff_swap_scnhdr_in (abfd, ext, in)
bfd *abfd;
/* Copy the symbol's name into the string table. */
sprintf (vars->string_ptr, "%s%s", prefix, symbol_name);
+ if (section == NULL)
+ section = (asection_ptr) & bfd_und_section;
+
/* Initialise the external symbol. */
bfd_h_put_32 (vars->abfd, vars->string_ptr - vars->string_table, (bfd_byte *) esym->e.e.e_offset);
- if (section)
- bfd_h_put_16 (vars->abfd, section->target_index, (bfd_byte *) esym->e_scnum);
- else
- bfd_h_put_16 (vars->abfd, 0, (bfd_byte *) esym->e_scnum);
-
+ bfd_h_put_16 (vars->abfd, section->target_index, (bfd_byte *) esym->e_scnum);
esym->e_sclass[0] = sclass;
/* The following initialisations are unnecessary - the memory is
/* Initialise the internal symbol structure. */
ent->u.syment.n_sclass = sclass;
- if (section)
- ent->u.syment.n_scnum = section->target_index;
+ ent->u.syment.n_scnum = section->target_index;
ent->u.syment._n._n_n._n_offset = (long) sym;
#if 0 /* See comment above. */
/* XXX - treat as IMPORT_NAME ??? */
abort ();
- * (unsigned int *) id4->contents = ordinal | 0x80000000UL;
- * (unsigned int *) id5->contents = ordinal | 0x80000000UL;
+ * (unsigned int *) id4->contents = ordinal | 0x80000000;
+ * (unsigned int *) id5->contents = ordinal | 0x80000000;
}
else
{
case IMAGE_FILE_MACHINE_THUMB:
#ifdef THUMBPEMAGIC
{
- extern bfd_target armpei_little_vec;
+ extern bfd_target TARGET_LITTLE_SYM;
- if (abfd->xvec == & armpei_little_vec)
+ if (abfd->xvec == & TARGET_LITTLE_SYM)
magic = THUMBPEMAGIC;
}
#endif