Lines Matching refs:archive
1 /* BFD back-end for archive files (libraries).
22 @setfilename archive-info
27 An archive (or library) is just another BFD. It has a symbol
30 The big difference between an archive BFD and an ordinary BFD
31 is that the archive doesn't have sections. Instead it has a
34 archive opened for reading will all be opened for reading. You
35 may put either input or output BFDs into an archive opened for
36 output; they will be handled correctly when the archive is closed.
39 the contents of an archive opened for input. You don't
40 have to read the entire archive if you don't want
45 then a second iteration through the members of an archive may
46 return the same BFD. If you close the archive BFD, then all
49 Archive contents of output BFDs are chained through the
51 through the <<archive_head>> slot of the archive. Set it with
53 one open output archive at a time.
55 As expected, the BFD archive code is more general than the
56 archive code of any given environment. BFD archives may
61 This can cause unexpected confusion, since some archive
79 Archives are supported in BFD in <<archive.c>>.
82 Archive functions
86 o - all archive elements start on an even boundary, newline padded;
92 (16 chars) space provided by a BSD archive. The trick is: make a
93 special "file" in the front of the archive, sort of like the SYMDEF
101 order to write an archive since you need to put a magic file at the
113 /* Summary of archive member names:
149 /* We keep a cache of archive filepointers to archive elements to
150 speed up searching the archive by filepos. We only add an entry to
243 Step through archive @var{abfd}'s symbol table (if it
252 A <<carsym>> is a canonical archive symbol. The only
293 BFDs contained in the archive @var{output} to @var{new_head}.
386 /* PR 15140: Don't allow a nested archive pointing to itself. */
431 /* In a thin archive, a member of an archive-within-an-archive
432 will have the offset in the inner archive encoded here. */
508 /* Extract the filename from the archive - there are two ways to
601 /* Append the relative pathname for a member of the thin archive
602 to the pathname of the directory containing the archive. */
626 through the archive symbol table, but also used to get the next
630 _bfd_get_elt_at_filepos (bfd *archive, file_ptr filepos)
636 n_nfd = _bfd_look_for_bfd_in_cache (archive, filepos);
640 if (0 > bfd_seek (archive, filepos, SEEK_SET))
643 if ((new_areldata = (struct areltdata *) _bfd_read_ar_hdr (archive)) == NULL)
648 if (bfd_is_thin_archive (archive))
655 filename = _bfd_append_relative_path (archive, filename);
665 /* This proxy entry refers to an element of a nested archive.
666 Locate the member of that archive and return a bfd for it. */
667 bfd *ext_arch = _bfd_find_nested_archive (archive, filename);
681 n_nfd->proxy_origin = bfd_tell (archive);
684 /* It's not an element of a nested archive;
687 if (!archive->target_defaulted)
688 target = archive->xvec->name;
695 n_nfd = _bfd_create_empty_archive_element_shell (archive);
704 n_nfd->proxy_origin = bfd_tell (archive);
706 if (bfd_is_thin_archive (archive))
719 n_nfd->flags |= archive->flags & (BFD_COMPRESS | BFD_DECOMPRESS);
721 if (_bfd_add_bfd_to_archive_cache (archive, filepos, n_nfd))
746 bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous);
749 Provided a BFD, @var{archive}, containing an archive and NULL, open
752 the archive and the previous return value to return a created
758 bfd_openr_next_archived_file (bfd *archive, bfd *last_file)
760 if ((bfd_get_format (archive) != bfd_archive)
761 || (archive->direction == write_direction))
767 return BFD_SEND (archive,
768 openr_next_archived_file, (archive, last_file));
772 bfd_generic_openr_next_archived_file (bfd *archive, bfd *last_file)
777 filestart = bfd_ardata (archive)->first_file_filepos;
783 if (! bfd_is_thin_archive (archive))
791 return _bfd_get_elt_at_filepos (archive, filestart);
848 /* This archive has a map, so we may presume that the contents
850 archive can be recognized as an object file, it is for this
856 normal archive, regardless of the format of the object files.
857 We do accept an empty archive. */
873 /* Some constants for a 32 bit BSD archive structure. We do not
890 /* Read a BSD-style archive symbol table. Returns FALSE on error,
961 /* Read a COFF archive symbol table. Returns FALSE on error, TRUE
992 /* It seems that all numeric information in a coff archive is always
998 /* ... except that some archive formats are broken, and it may be our
1063 /* Check for a second archive header (as used by PE). */
1091 (archive symbol table). Returns FALSE on error, TRUE otherwise */
1114 /* 64bit ELF (Irix 6) archive. */
1175 /* The archive has at least 16 bytes in it. */
1263 element (the first in the archive, or second if there is an armap);
1323 /* Since the archive is supposed to be printable if it contains
1326 trailing '/'. DOS/NT created archive often have \ in them
1587 /* If the element being added is a member of another archive
1588 (i.e., we are flattening), use the containing archive's name. */
1595 archive that contains other archives. */
1602 the containing archive. */
1609 /* In a thin archive, always store the full pathname
1680 /* If the element being added is a member of another archive
1681 (i.e., we are flattening), use the containing archive's name. */
1687 archive that contains other archives.
1689 the containing archive. */
1709 encounter an oddball archive format and want to
1796 /* Write an archive header. */
1799 _bfd_generic_write_ar_hdr (bfd *archive, bfd *abfd)
1803 if (bfd_bwrite (hdr, sizeof (*hdr), archive) != sizeof (*hdr))
1808 /* Write an archive header using BSD4.4 convention. */
1811 _bfd_bsd44_write_ar_hdr (bfd *archive, bfd *abfd)
1828 if (bfd_bwrite (hdr, sizeof (*hdr), archive) != sizeof (*hdr))
1831 if (bfd_bwrite (fullname, len, archive) != len)
1839 if (bfd_bwrite (pad, len, archive) != len)
1845 if (bfd_bwrite (hdr, sizeof (*hdr), archive) != sizeof (*hdr))
2132 filesystem (as opposed to living in an archive open for input)
2139 from (which are usually either an object file or archive on
2140 disk), not the archive entries we're writing to. We don't
2141 actually create bfds for the archive members, we just copy
2142 them byte-wise when we write out the archive. */
2192 /* Round size up to even number in archive header. */
2250 /* Verify the timestamp in the archive file. If it would not be
2262 (_("Warning: writing archive was slow: rewriting timestamp\n"));
2361 /* This symbol will go into the archive header. */
2450 Some linkers may require that the archive filesystem modification
2451 time is less than (or near to) the archive map timestamp. Those
2505 /* The archive file format only has 4 bytes to store the offset
2546 /* At the end of archive file handling, update the timestamp in the
2567 bfd_perror (_("Reading archive file mod timestamp"));
2623 archive * the number of bytes in an int, + an int for the count. */
2636 /* Work out where the first object file will go in the archive. */
2674 out the object file's address in the archive. */
2680 /* Catch an attempt to grow an archive past its 4Gb limit. */
2693 /* Add size of this archive entry. */
2739 /* Close nested archives (if this bfd is a thin archive). */