Restore GET_SAVED_REGISTERS
[deliverable/binutils-gdb.git] / bfd / peicode.h
index 684d3d7aa9785fbc6ac7fefb00ac0a5a804e28c8..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;
@@ -592,13 +595,12 @@ pe_ILF_make_a_symbol (pe_ILF_vars *  vars,
   /* 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
@@ -612,8 +614,7 @@ pe_ILF_make_a_symbol (pe_ILF_vars *  vars,
   
   /* 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.  */
@@ -907,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
     {
@@ -1168,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.03055 seconds and 4 git commands to generate.