fprintf (stderr, "Output file cannot represent architecture %s\n",
fprintf (stderr, "Warning: Output file cannot represent architecture %s\n",
copy_object (ibfd, obfd)     bfd *ibfd;     bfd *obfd;{  bfd_vma start;  long symcount;  asection **osections = NULL;  bfd_size_type *gaps = NULL;  bfd_size_type max_gap = 0;  if (!bfd_set_format (obfd, bfd_get_format (ibfd)))    {      nonfatal (bfd_get_filename (obfd));    }  if (verbose)    printf ("copy from %s(%s) to %s(%s)\n",	    bfd_get_filename(ibfd), bfd_get_target(ibfd),	    bfd_get_filename(obfd), bfd_get_target(obfd));  if (set_start_set)    start = set_start;  else    start = bfd_get_start_address (ibfd);  start += adjust_start;  if (!bfd_set_start_address (obfd, start)      || !bfd_set_file_flags (obfd,			      (bfd_get_file_flags (ibfd)			       & bfd_applicable_file_flags (obfd))))    {      nonfatal (bfd_get_filename (ibfd));    }  /* Copy architecture of input file to output file */  if (!bfd_set_arch_mach (obfd, bfd_get_arch (ibfd),			  bfd_get_mach (ibfd)))    {      fprintf (stderr, "Output file cannot represent architecture %s\n",	       bfd_printable_arch_mach (bfd_get_arch (ibfd),					bfd_get_mach (ibfd)));    }  if (!bfd_set_format (obfd, bfd_get_format (ibfd)))    {      nonfatal (bfd_get_filename(ibfd));    }  if (isympp)    free (isympp);  if (osympp != isympp)    free (osympp);  /* bfd mandates that all output sections be created and sizes set before     any output is done.  Thus, we traverse all sections multiple times.  */  bfd_map_over_sections (ibfd, setup_section, (void *) obfd);  if (add_sections != NULL)    {      struct section_add *padd;      struct section_list *pset;      for (padd = add_sections; padd != NULL; padd = padd->next)	{	  padd->section = bfd_make_section (obfd, padd->name);	  if (padd->section == NULL)	    {	      fprintf (stderr, "%s: can't create section `%s': %s\n",		       program_name, padd->name,		       bfd_errmsg (bfd_get_error ()));	      status = 1;	      return;	    }	  else	    {	      flagword flags;	      	      if (! bfd_set_section_size (obfd, padd->section, padd->size))		nonfatal (bfd_get_filename (obfd));	      pset = find_section_list (padd->name, false);	      if (pset != NULL)		pset->used = true;	      if (pset != NULL && pset->set_flags)		flags = pset->flags | SEC_HAS_CONTENTS;	      else		flags = SEC_HAS_CONTENTS | SEC_READONLY | SEC_DATA;	      if (! bfd_set_section_flags (obfd, padd->section, flags))		nonfatal (bfd_get_filename (obfd));	      if (pset != NULL		  && (pset->adjust == adjust_vma		      || pset->adjust == set_vma))		{		  if (! bfd_set_section_vma (obfd, padd->section, pset->val))		    nonfatal (bfd_get_filename (obfd));		}	    }	}    }  if (gap_fill_set || pad_to_set)    {      asection **set;      unsigned int c, i;      /* We must fill in gaps between the sections and/or we must pad	 the last section to a specified address.  We do this by	 grabbing a list of the sections, sorting them by VMA, and	 increasing the section sizes as required to fill the gaps.	 We write out the gap contents below.  */      c = bfd_count_sections (obfd);      osections = (asection **) xmalloc (c * sizeof (asection *));      set = osections;      bfd_map_over_sections (obfd, get_sections, (void *) &set);      qsort (osections, c, sizeof (asection *), compare_section_vma);      gaps = (bfd_size_type *) xmalloc (c * sizeof (bfd_size_type));      memset (gaps, 0, c * sizeof (bfd_size_type));      if (gap_fill_set)	{	  for (i = 0; i < c - 1; i++)	    {	      flagword flags;	      bfd_size_type size;	      bfd_vma gap_start, gap_stop;	      flags = bfd_get_section_flags (obfd, osections[i]);	      if ((flags & SEC_HAS_CONTENTS) == 0		  || (flags & SEC_LOAD) == 0)		continue;	      size = bfd_section_size (obfd, osections[i]);	      gap_start = bfd_section_vma (obfd, osections[i]) + size;	      gap_stop = bfd_section_vma (obfd, osections[i + 1]);	      if (gap_start < gap_stop)		{		  if (! bfd_set_section_size (obfd, osections[i],					      size + (gap_stop - gap_start)))		    {		      fprintf (stderr, "%s: Can't fill gap after %s: %s\n",			       program_name,			       bfd_get_section_name (obfd, osections[i]),			       bfd_errmsg (bfd_get_error()));		      status = 1;		      break;		    }		  gaps[i] = gap_stop - gap_start;		  if (max_gap < gap_stop - gap_start)		    max_gap = gap_stop - gap_start;		}	    }	}      if (pad_to_set)	{	  bfd_vma vma;	  bfd_size_type size;	  vma = bfd_section_vma (obfd, osections[c - 1]);	  size = bfd_section_size (obfd, osections[c - 1]);	  if (vma + size < pad_to)	    {	      if (! bfd_set_section_size (obfd, osections[c - 1],					  pad_to - vma))		{		  fprintf (stderr, "%s: Can't add padding to %s: %s\n",			   program_name,			   bfd_get_section_name (obfd, osections[c - 1]),			   bfd_errmsg (bfd_get_error ()));		  status = 1;		}	      else		{		  gaps[c - 1] = pad_to - (vma + size);		  if (max_gap < pad_to - (vma + size))		    max_gap = pad_to - (vma + size);		}	    }	}	          }  /* Symbol filtering must happen after the output sections have     been created, but before their contents are set.  */  if (strip_symbols == strip_all)    {      osympp = isympp = NULL;      symcount = 0;    }  else    {      long symsize;      symsize = bfd_get_symtab_upper_bound (ibfd);      if (symsize < 0)	{	  nonfatal (bfd_get_filename (ibfd));	}      osympp = isympp = (asymbol **) xmalloc (symsize);      symcount = bfd_canonicalize_symtab (ibfd, isympp);      if (symcount < 0)	{	  nonfatal (bfd_get_filename (ibfd));	}      if (strip_symbols == strip_debug 	  || strip_symbols == strip_unneeded	  || discard_locals != locals_undef	  || strip_specific_list != NULL	  || sections_removed)	{	  /* Mark symbols used in output relocations so that they	     are kept, even if they are local labels or static symbols.	     Note we iterate over the input sections examining their	     relocations since the relocations for the output sections	     haven't been set yet.  mark_symbols_used_in_relocations will	     ignore input sections which have no corresponding output	     section.  */	  bfd_map_over_sections (ibfd,				 mark_symbols_used_in_relocations,				 (PTR)isympp);	  osympp = (asymbol **) xmalloc (symcount * sizeof (asymbol *));	  symcount = filter_symbols (ibfd, osympp, isympp, symcount);	}    }  bfd_set_symtab (obfd, osympp, symcount);  /* This has to happen after the symbol table has been set.  */  bfd_map_over_sections (ibfd, copy_section, (void *) obfd);  if (add_sections != NULL)    {      struct section_add *padd;      for (padd = add_sections; padd != NULL; padd = padd->next)	{	  if (! bfd_set_section_contents (obfd, padd->section,					  (PTR) padd->contents,					  (file_ptr) 0,					  (bfd_size_type) padd->size))	    nonfatal (bfd_get_filename (obfd));	}    }  if (gap_fill_set || pad_to_set)    {      bfd_byte *buf;      int c, i;      /* Fill in the gaps.  */      if (max_gap > 8192)	max_gap = 8192;      buf = (bfd_byte *) xmalloc (max_gap);      memset (buf, gap_fill, (size_t) max_gap);      c = bfd_count_sections (obfd);      for (i = 0; i < c; i++)	{	  if (gaps[i] != 0)	    {	      bfd_size_type left;	      file_ptr off;	      left = gaps[i];	      off = bfd_section_size (obfd, osections[i]) - left;	      while (left > 0)		{		  bfd_size_type now;		  if (left > 8192)		    now = 8192;		  else		    now = left;		  if (! bfd_set_section_contents (obfd, osections[i], buf,						  off, now))		    {		      nonfatal (bfd_get_filename (obfd));		    }		  left -= now;		  off += now;		}	    }	}    }  /* Allow the BFD backend to copy any private data it understands     from the input BFD to the output BFD.  This is done last to     permit the routine to look at the filtered symbol table, which is     important for the ECOFF code at least.  */  if (!bfd_copy_private_bfd_data (ibfd, obfd))    {      fprintf (stderr, "%s: %s: error copying private BFD data: %s\n",	       program_name, bfd_get_filename (obfd),	       bfd_errmsg (bfd_get_error ()));      status = 1;      return;    }}