* peicode.h (coff_swap_filehdr_in): can't use e_magic because we
[deliverable/binutils-gdb.git] / bfd / peicode.h
index 7238c7802e8ed0cb47f1350df0c00aa49f042702..9071c72b29e9668ad5e443f43c55a733851bc0b2 100644 (file)
@@ -69,7 +69,6 @@ static boolean (*pe_saved_coff_bfd_print_private_bfd_data)
 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
@@ -221,8 +220,13 @@ coff_swap_filehdr_in (abfd, src, dst)
      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
@@ -243,7 +247,6 @@ coff_swap_filehdr_in (abfd, src, dst)
 #define coff_swap_filehdr_out _bfd_pe_only_swap_filehdr_out
 #endif
 
-
 static void
 coff_swap_scnhdr_in (abfd, ext, in)
      bfd            *abfd;
@@ -905,8 +908,8 @@ pe_ILF_build_a_bfd (bfd *           abfd,
        /* 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
     {
@@ -1166,9 +1169,9 @@ pe_ILF_object_p (bfd * abfd)
     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      
This page took 0.023867 seconds and 4 git commands to generate.