This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: a patch to set ELF header flags for empty linker output files


In message <200101160034.QAA18950@wilson.cygnus.com>, Jim Wilson writes:
>Another alternative is to change bfd_merge_private_bfd_data so that it
>ignores empty input files.  Thus we get no error when we link in the
>empty drm.o file even though it has the wrong machine dependent ELF header
>flag bits set.

We used this approach to fix a similar problem on ARM.

  /* Check to see if the input BFD actually contains any sections.
     If not, its flags may not have been initialised either, but it cannot
     actually cause any incompatibility.  */
  for (sec = ibfd->sections; sec != NULL; sec = sec->next)
    {
      /* Ignore synthetic glue sections.  */
      if (strcmp (sec->name, ".glue_7")
	  && strcmp (sec->name, ".glue_7t"))
	{
	  null_input_bfd = false;
	  break;
	}
    }
  if (null_input_bfd)
    return true;

p.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]