* binutils-all/objdump.exp: Add m16c and m32c to the list of
[deliverable/binutils-gdb.git] / bfd / peXXigen.c
index fe712a6f0e0c28d9717f25aa8ef38d9246a87bb6..17dafeb4a087093a6da43343b7fe6ed31628369a 100644 (file)
@@ -130,7 +130,7 @@ _bfd_XXi_swap_sym_in (bfd * abfd, void * ext1, void * in1)
   if (in->n_sclass == C_SECTION)
     {
       char namebuf[SYMNMLEN + 1];
-      const char *name;
+      const char *name = NULL;
 
       in->n_value = 0x0;
 
@@ -548,17 +548,6 @@ _bfd_XXi_swap_aouthdr_out (bfd * abfd, void * in, void * out)
   bfd_vma sa, fa, ib;
   IMAGE_DATA_DIRECTORY idata2, idata5, tls;
   
-  if (pe->force_minimum_alignment)
-    {
-      if (!extra->FileAlignment)
-       extra->FileAlignment = PE_DEF_FILE_ALIGNMENT;
-      if (!extra->SectionAlignment)
-       extra->SectionAlignment = PE_DEF_SECTION_ALIGNMENT;
-    }
-
-  if (extra->Subsystem == IMAGE_SUBSYSTEM_UNKNOWN)
-    extra->Subsystem = pe->target_subsystem;
-
   sa = extra->SectionAlignment;
   fa = extra->FileAlignment;
   ib = extra->ImageBase;
@@ -1480,7 +1469,7 @@ pe_print_edata (bfd * abfd, void * vfile)
 
   fprintf (file,
           _("Name \t\t\t\t"));
-  fprintf_vma (file, edt.name);
+  bfd_fprintf_vma (abfd, file, edt.name);
   fprintf (file,
           " %s\n", data + edt.name - adj);
 
@@ -1502,17 +1491,17 @@ pe_print_edata (bfd * abfd, void * vfile)
 
   fprintf (file,
           _("\tExport Address Table \t\t"));
-  fprintf_vma (file, edt.eat_addr);
+  bfd_fprintf_vma (abfd, file, edt.eat_addr);
   fprintf (file, "\n");
 
   fprintf (file,
           _("\tName Pointer Table \t\t"));
-  fprintf_vma (file, edt.npt_addr);
+  bfd_fprintf_vma (abfd, file, edt.npt_addr);
   fprintf (file, "\n");
 
   fprintf (file,
           _("\tOrdinal Table \t\t\t"));
-  fprintf_vma (file, edt.ot_addr);
+  bfd_fprintf_vma (abfd, file, edt.ot_addr);
   fprintf (file, "\n");
 
   /* The next table to find is the Export Address Table. It's basically
@@ -1677,14 +1666,14 @@ pe_print_pdata (bfd * abfd, void * vfile)
       prolog_end_addr &= ~(bfd_vma) 0x3;
 
       fputc (' ', file);
-      fprintf_vma (file, i + section->vma); fputc ('\t', file);
-      fprintf_vma (file, begin_addr); fputc (' ', file);
-      fprintf_vma (file, end_addr); fputc (' ', file);
-      fprintf_vma (file, eh_handler);
+      bfd_fprintf_vma (abfd, file, i + section->vma); fputc ('\t', file);
+      bfd_fprintf_vma (abfd, file, begin_addr); fputc (' ', file);
+      bfd_fprintf_vma (abfd, file, end_addr); fputc (' ', file);
+      bfd_fprintf_vma (abfd, file, eh_handler);
 #if !defined(COFF_WITH_pep) || defined(COFF_WITH_pex64)
       fputc (' ', file);
-      fprintf_vma (file, eh_data); fputc (' ', file);
-      fprintf_vma (file, prolog_end_addr);
+      bfd_fprintf_vma (abfd, file, eh_data); fputc (' ', file);
+      bfd_fprintf_vma (abfd, file, prolog_end_addr);
       fprintf (file, "   %x", em_data);
 #endif
 
@@ -1849,10 +1838,10 @@ _bfd_XX_print_ce_compressed_pdata (bfd * abfd, void * vfile)
       exception_flag = (int)((other_data & 0x80000000) >> 31);
 
       fputc (' ', file);
-      fprintf_vma (file, i + section->vma); fputc ('\t', file);
-      fprintf_vma (file, begin_addr); fputc (' ', file);
-      fprintf_vma (file, prolog_length); fputc (' ', file);
-      fprintf_vma (file, function_length); fputc (' ', file);
+      bfd_fprintf_vma (abfd, file, i + section->vma); fputc ('\t', file);
+      bfd_fprintf_vma (abfd, file, begin_addr); fputc (' ', file);
+      bfd_fprintf_vma (abfd, file, prolog_length); fputc (' ', file);
+      bfd_fprintf_vma (abfd, file, function_length); fputc (' ', file);
       fprintf (file, "%2d  %2d   ", flag32bit, exception_flag);
 
       /* Get the exception handler's address and the data passed from the
@@ -1903,87 +1892,6 @@ _bfd_XX_print_ce_compressed_pdata (bfd * abfd, void * vfile)
 #undef PDATA_ROW_SIZE
 }
 
-#ifdef COFF_WITH_pex64
-/* The PE+ x64 variant.  */
-bfd_boolean
-_bfd_pex64_print_pdata (bfd *abfd, void *vfile)
-{
-# define PDATA_ROW_SIZE        (3 * 4)
-  FILE *file = (FILE *) vfile;
-  bfd_byte *data = NULL;
-  asection *section = bfd_get_section_by_name (abfd, ".pdata");
-  bfd_size_type datasize = 0;
-  bfd_size_type i;
-  bfd_size_type start, stop;
-  int onaline = PDATA_ROW_SIZE;
-  struct sym_cache sym_cache = {0, 0};
-
-  if (section == NULL
-      || coff_section_data (abfd, section) == NULL
-      || pei_section_data (abfd, section) == NULL)
-    return TRUE;
-
-  stop = pei_section_data (abfd, section)->virt_size;
-  if ((stop % onaline) != 0)
-    fprintf (file,
-             _("warning: .pdata section size (%ld) is not a multiple of %d\n"),
-            (long) stop, onaline);
-
-  fprintf (file,
-          _("\nThe Function Table (interpreted .pdata section contents)\n"));
-
-  fprintf (file, _("vma:\t\t\tBeginAddress\t EndAddress\t  UnwindData\n"));
-
-  datasize = section->size;
-  if (datasize == 0)
-    return TRUE;
-
-  if (!bfd_malloc_and_get_section (abfd, section, &data))
-    {
-      if (data != NULL)
-       free (data);
-      return FALSE;
-    }
-
-  start = 0;
-
-  for (i = start; i < stop; i += onaline)
-    {
-      bfd_vma begin_addr;
-      bfd_vma end_addr;
-      bfd_vma unwind_data_addr;
-
-      if (i + PDATA_ROW_SIZE > stop)
-       break;
-
-      begin_addr = bfd_get_32 (abfd, data + i);
-      end_addr = bfd_get_32 (abfd, data + i + 4);
-      unwind_data_addr = bfd_get_32 (abfd, data + i +  8);
-
-      if (begin_addr == 0 && end_addr == 0 && unwind_data_addr == 0)
-       /* We are probably into the padding of the section now.  */
-       break;
-
-      fputc (' ', file);
-      fprintf_vma (file, i + section->vma);
-      fprintf (file, ":\t");
-      fprintf_vma (file, begin_addr);
-      fputc (' ', file);
-      fprintf_vma (file, end_addr);
-      fputc (' ', file);
-      fprintf_vma (file, unwind_data_addr);
-
-      fprintf (file, "\n");
-    }
-
-  free (data);
-
-  cleanup_syms (&sym_cache);
-
-  return TRUE;
-#undef PDATA_ROW_SIZE
-}
-#endif
 \f
 #define IMAGE_REL_BASED_HIGHADJ 4
 static const char * const tbl[] =
@@ -2160,21 +2068,21 @@ _bfd_XX_print_private_bfd_data_common (bfd * abfd, void * vfile)
   fprintf (file, "SizeOfUninitializedData\t%08lx\n",
           (unsigned long) i->SizeOfUninitializedData);
   fprintf (file, "AddressOfEntryPoint\t");
-  fprintf_vma (file, i->AddressOfEntryPoint);
+  bfd_fprintf_vma (abfd, file, i->AddressOfEntryPoint);
   fprintf (file, "\nBaseOfCode\t\t");
-  fprintf_vma (file, i->BaseOfCode);
+  bfd_fprintf_vma (abfd, file, i->BaseOfCode);
 #if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64)
   /* PE32+ does not have BaseOfData member!  */
   fprintf (file, "\nBaseOfData\t\t");
-  fprintf_vma (file, i->BaseOfData);
+  bfd_fprintf_vma (abfd, file, i->BaseOfData);
 #endif
 
   fprintf (file, "\nImageBase\t\t");
-  fprintf_vma (file, i->ImageBase);
+  bfd_fprintf_vma (abfd, file, i->ImageBase);
   fprintf (file, "\nSectionAlignment\t");
-  fprintf_vma (file, i->SectionAlignment);
+  bfd_fprintf_vma (abfd, file, i->SectionAlignment);
   fprintf (file, "\nFileAlignment\t\t");
-  fprintf_vma (file, i->FileAlignment);
+  bfd_fprintf_vma (abfd, file, i->FileAlignment);
   fprintf (file, "\nMajorOSystemVersion\t%d\n", i->MajorOperatingSystemVersion);
   fprintf (file, "MinorOSystemVersion\t%d\n", i->MinorOperatingSystemVersion);
   fprintf (file, "MajorImageVersion\t%d\n", i->MajorImageVersion);
@@ -2233,13 +2141,13 @@ _bfd_XX_print_private_bfd_data_common (bfd * abfd, void * vfile)
     fprintf (file, "\t(%s)", subsystem_name);
   fprintf (file, "\nDllCharacteristics\t%08x\n", i->DllCharacteristics);
   fprintf (file, "SizeOfStackReserve\t");
-  fprintf_vma (file, i->SizeOfStackReserve);
+  bfd_fprintf_vma (abfd, file, i->SizeOfStackReserve);
   fprintf (file, "\nSizeOfStackCommit\t");
-  fprintf_vma (file, i->SizeOfStackCommit);
+  bfd_fprintf_vma (abfd, file, i->SizeOfStackCommit);
   fprintf (file, "\nSizeOfHeapReserve\t");
-  fprintf_vma (file, i->SizeOfHeapReserve);
+  bfd_fprintf_vma (abfd, file, i->SizeOfHeapReserve);
   fprintf (file, "\nSizeOfHeapCommit\t");
-  fprintf_vma (file, i->SizeOfHeapCommit);
+  bfd_fprintf_vma (abfd, file, i->SizeOfHeapCommit);
   fprintf (file, "\nLoaderFlags\t\t%08lx\n", (unsigned long) i->LoaderFlags);
   fprintf (file, "NumberOfRvaAndSizes\t%08lx\n",
           (unsigned long) i->NumberOfRvaAndSizes);
@@ -2248,7 +2156,7 @@ _bfd_XX_print_private_bfd_data_common (bfd * abfd, void * vfile)
   for (j = 0; j < IMAGE_NUMBEROF_DIRECTORY_ENTRIES; j++)
     {
       fprintf (file, "Entry %1x ", j);
-      fprintf_vma (file, i->DataDirectory[j].VirtualAddress);
+      bfd_fprintf_vma (abfd, file, i->DataDirectory[j].VirtualAddress);
       fprintf (file, " %08lx ", (unsigned long) i->DataDirectory[j].Size);
       fprintf (file, "%s\n", dir_names[j]);
     }
@@ -2280,7 +2188,7 @@ _bfd_XX_bfd_copy_private_bfd_data_common (bfd * ibfd, bfd * obfd)
   ipe = pe_data (ibfd);
   ope = pe_data (obfd);
  
-  ope->pe_opthdr = ipe->pe_opthdr;
+  /* pe_opthdr is copied in copy_object.  */
   ope->dll = ipe->dll;
 
   /* Don't copy input subsystem if output is different from input.  */
This page took 0.02665 seconds and 4 git commands to generate.