+2005-06-08 Mark Mitchell <mark@codesourcery.com>
+
+ * opncls.c (bfd_fopen): Mark returned BFD as cacheable if FD == -1.
+
2005-06-09 Alan Modra <amodra@bigpond.net.au>
* elflink.c (elf_mark_used_section): Delete.
Calls <<bfd_find_target>>, so @var{target} is interpreted as by
that function.
+ The new BFD is marked as cacheable iff @var{fd} is -1.
+
If <<NULL>> is returned then an error has occured. Possible errors
are <<bfd_error_no_memory>>, <<bfd_error_invalid_target>> or
<<system_call>> error.
return NULL;
}
nbfd->opened_once = TRUE;
+ /* If we opened the file by name, mark it cacheable; we can close it
+ and reopen it later. However, if a file descriptor was provided,
+ then it may have been opened with special flags that make it
+ unsafe to close and reopen the file. */
+ if (fd == -1)
+ bfd_set_cacheable (nbfd, TRUE);
return nbfd;
}