1@findex bfd_get_mtime
2@subsubsection @code{bfd_get_mtime}
3@strong{Synopsis}
4@example
5long bfd_get_mtime (bfd *abfd);
6@end example
7@strong{Description}@*
8Return the file modification time (as read from the file system, or
9from the archive header for archive members).
10
11@findex bfd_get_size
12@subsubsection @code{bfd_get_size}
13@strong{Synopsis}
14@example
15long bfd_get_size (bfd *abfd);
16@end example
17@strong{Description}@*
18Return the file size (as read from file system) for the file
19associated with BFD @var{abfd}.
20
21The initial motivation for, and use of, this routine is not
22so we can get the exact size of the object the BFD applies to, since
23that might not be generally possible (archive members for example).
24It would be ideal if someone could eventually modify
25it so that such results were guaranteed.
26
27Instead, we want to ask questions like "is this NNN byte sized
28object I'm about to try read from file offset YYY reasonable?"
29As as example of where we might do this, some object formats
30use string tables for which the first @code{sizeof (long)} bytes of the
31table contain the size of the table itself, including the size bytes.
32If an application tries to read what it thinks is one of these
33string tables, without some way to validate the size, and for
34some reason the size is wrong (byte swapping error, wrong location
35for the string table, etc.), the only clue is likely to be a read
36error when it tries to read the table, or a "virtual memory
37exhausted" error when it tries to allocate 15 bazillon bytes
38of space for the 15 bazillon byte table it is about to read.
39This function at least allows us to answer the question, "is the
40size reasonable?".
41
42