2.15 problem building GCC arm-elf cross-compiler on Solaris/HP-UX

Nick Clifton nickc@redhat.com
Thu Sep 30 17:47:00 GMT 2004


Hi Albert,

> In _bfd_compute_and_write_armap(), we fall into (line 1797):
>   /* Map over each element.  */
>   for (current = arch->archive_head;
>        current != NULL;
>        current = current->next, elt_no++)
>     {
> 
> At this point, the arch->where member is 8. After this loop completes,
> the arch->where member is 0, forcing new data written to the output
> file to be written at offset 0, not 8, thereby overwriting
> "!<arch>\012". I traced through the loop and, at the final iteration
> of the loop, before current != NULL, a call is made to (line 1802):
>       if (bfd_check_format (current, bfd_object)
>           && (bfd_get_file_flags (current) & HAS_SYMS) != 0)
>         {
> 
> The call to bfd_check_format (current, bfd_object) resets arch->member
> to 0. I don't know why yet. Does this help anyone?

Hmm, I wonder if this is to do with this patch:

   2004-05-19  Mikulas Patocka  <mikulas@artax.karlin.mff.cuni.cz>
	* archive.c (_bfd_get_elt_at_filepos): Cope with a nested
           archives.
	  (bfd_generic_openr_next_archived_file): Likewise.

If, for some reason, the bfd_check_format() thought that it was dealing 
with a nested archive it might reset the arch->where field of the outer, 
parent archive.  Just a guess mind you.

Cheers
   Nick



More information about the Binutils mailing list