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?