Lines Matching defs: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
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>>.
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}.
318 an archive, and checking for an archive means one element has
385 open_nested_file (const char *filename, bfd *archive)
391 if (!archive->target_defaulted)
392 target = archive->xvec->name;
396 n_bfd->lto_output = archive->lto_output;
397 n_bfd->no_export = archive->no_export;
398 n_bfd->my_archive = archive;
408 /* PR 15140: Don't allow a nested archive pointing to itself. */
450 /* In a thin archive, a member of an archive-within-an-archive
451 will have the offset in the inner archive encoded here. */
528 /* Extract the filename from the archive - there are two ways to
629 /* Append the relative pathname for a member of the thin archive
630 to the pathname of the directory containing the archive. */
654 through the archive symbol table, but also used to get the next
658 _bfd_get_elt_at_filepos (bfd *archive, file_ptr filepos,
665 n_bfd = _bfd_look_for_bfd_in_cache (archive, filepos);
669 if (0 > bfd_seek (archive, filepos, SEEK_SET))
672 if ((new_areldata = (struct areltdata *) _bfd_read_ar_hdr (archive)) == NULL)
677 if (bfd_is_thin_archive (archive))
682 filename = _bfd_append_relative_path (archive, filename);
692 /* This proxy entry refers to an element of a nested archive.
693 Locate the member of that archive and return a bfd for it. */
694 bfd *ext_arch = find_nested_archive (filename, archive);
709 n_bfd->proxy_origin = bfd_tell (archive);
713 n_bfd->flags |= archive->flags & (BFD_COMPRESS
720 /* It's not an element of a nested archive;
723 n_bfd = open_nested_file (filename, archive);
737 (_("%F%P: %pB(%s): error opening thin archive member: %E\n"),
738 archive, filename);
747 n_bfd = _bfd_create_empty_archive_element_shell (archive);
756 n_bfd->proxy_origin = bfd_tell (archive);
758 if (bfd_is_thin_archive (archive))
772 n_bfd->flags |= archive->flags & (BFD_COMPRESS
777 n_bfd->is_linker_input = archive->is_linker_input;
779 if (archive->no_element_cache
780 || _bfd_add_bfd_to_archive_cache (archive, filepos, n_bfd))
814 bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous);
817 Provided a BFD, @var{archive}, containing an archive and NULL, open
819 Subsequent calls should pass the archive and the previous return
827 bfd_openr_next_archived_file (bfd *archive, bfd *last_file)
829 if ((bfd_get_format (archive) != bfd_archive)
830 || (archive->direction == write_direction))
836 return BFD_SEND (archive,
837 openr_next_archived_file, (archive, last_file));
841 bfd_generic_openr_next_archived_file (bfd *archive, bfd *last_file)
846 filestart = bfd_ardata (archive)->first_file_filepos;
850 if (! bfd_is_thin_archive (archive))
868 return _bfd_get_elt_at_filepos (archive, filestart, NULL);
872 _bfd_noarchive_openr_next_archived_file (bfd *archive,
875 return (bfd *) _bfd_ptr_bfd_null_error (archive);
935 /* This archive has a map, so we may presume that the contents
937 archive can be recognized as an object file, it is for this
943 normal archive, regardless of the format of the object files.
944 We do accept an empty archive. */
963 /* Some constants for a 32 bit BSD archive structure. We do not
980 /* Read a BSD-style archive symbol table. Returns FALSE on error,
1066 /* Read a COFF archive symbol table. Returns FALSE on error, TRUE
1095 /* It seems that all numeric information in a coff archive is always
1166 /* Check for a second archive header (as used by PE). */
1187 (archive symbol table). Returns FALSE on error, TRUE otherwise */
1210 /* 64bit (Irix 6) archive. */
1249 element (the first in the archive, or second if there is an armap);
1316 /* Since the archive is supposed to be printable if it contains
1319 trailing '/'. DOS/NT created archive often have \ in them
1593 /* If the element being added is a member of another archive
1594 (i.e., we are flattening), use the containing archive's name. */
1601 archive that contains other archives. */
1608 the containing archive. */
1615 /* In a thin archive, always store the full pathname
1686 /* If the element being added is a member of another archive
1687 (i.e., we are flattening), use the containing archive's name. */
1693 archive that contains other archives.
1695 the containing archive. */
1715 encounter an oddball archive format and want to
1793 /* Write an archive header. */
1796 _bfd_generic_write_ar_hdr (bfd *archive, bfd *abfd)
1800 if (bfd_bwrite (hdr, sizeof (*hdr), archive) != sizeof (*hdr))
1805 /* Write an archive header using BSD4.4 convention. */
1808 _bfd_bsd44_write_ar_hdr (bfd *archive, bfd *abfd)
1825 if (bfd_bwrite (hdr, sizeof (*hdr), archive) != sizeof (*hdr))
1828 if (bfd_bwrite (fullname, len, archive) != len)
1836 if (bfd_bwrite (pad, len, archive) != len)
1842 if (bfd_bwrite (hdr, sizeof (*hdr), archive) != sizeof (*hdr))
1849 _bfd_noarchive_write_ar_hdr (bfd *archive, bfd *abfd ATTRIBUTE_UNUSED)
1851 return _bfd_bool_bfd_false_error (archive);
2142 filesystem (as opposed to living in an archive open for input)
2149 from (which are usually either an object file or archive on
2150 disk), not the archive entries we're writing to. We don't
2151 actually create bfds for the archive members, we just copy
2152 them byte-wise when we write out the archive. */
2204 /* Round size up to even number in archive header. */
2258 /* Verify the timestamp in the archive file. If it would not be
2270 (_("warning: writing archive was slow: rewriting timestamp"));
2377 /* This symbol will go into the archive header. */
2492 /* The archive file format only has 4 bytes to store the offset
2493 of the member. Generate 64-bit archive if an archive is past
2505 Some linkers may require that the archive filesystem modification
2506 time is less than (or near to) the archive map timestamp. Those
2563 /* The archive file format only has 4 bytes to store the offset
2604 /* At the end of archive file handling, update the timestamp in the
2625 bfd_perror (_("Reading archive file mod timestamp"));
2681 archive * the number of bytes in an int, + an int for the count. */
2695 /* Work out where the first object file will go in the archive. */
2708 out the object file's address in the archive. */
2714 /* Generate 64-bit archive if an archive is past its 4Gb
2724 /* Add size of this archive entry. */
2766 out the object file's address in the archive. */
2772 /* Catch an attempt to grow an archive past its 4Gb limit. */
2785 /* Add size of this archive entry. */
2866 /* Close nested archives (if this bfd is a thin archive). */
2881 /* Close the archive plugin file descriptor if needed. */