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)
664 n_bfd = _bfd_look_for_bfd_in_cache (archive, filepos);
668 if (0 > bfd_seek (archive, filepos, SEEK_SET))
671 if ((new_areldata = (struct areltdata *) _bfd_read_ar_hdr (archive)) == NULL)
676 if (bfd_is_thin_archive (archive))
681 filename = _bfd_append_relative_path (archive, filename);
691 /* This proxy entry refers to an element of a nested archive.
692 Locate the member of that archive and return a bfd for it. */
693 bfd *ext_arch = find_nested_archive (filename, archive);
707 n_bfd->proxy_origin = bfd_tell (archive);
711 n_bfd->flags |= archive->flags & (BFD_COMPRESS
718 /* It's not an element of a nested archive;
720 n_bfd = open_nested_file (filename, archive);
726 n_bfd = _bfd_create_empty_archive_element_shell (archive);
735 n_bfd->proxy_origin = bfd_tell (archive);
737 if (bfd_is_thin_archive (archive))
751 n_bfd->flags |= archive->flags & (BFD_COMPRESS
756 n_bfd->is_linker_input = archive->is_linker_input;
758 if (archive->no_element_cache
759 || _bfd_add_bfd_to_archive_cache (archive, filepos, n_bfd))
793 bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous);
796 Provided a BFD, @var{archive}, containing an archive and NULL, open
798 Subsequent calls should pass the archive and the previous return
806 bfd_openr_next_archived_file (bfd *archive, bfd *last_file)
808 if ((bfd_get_format (archive) != bfd_archive)
809 || (archive->direction == write_direction))
815 return BFD_SEND (archive,
816 openr_next_archived_file, (archive, last_file));
820 bfd_generic_openr_next_archived_file (bfd *archive, bfd *last_file)
825 filestart = bfd_ardata (archive)->first_file_filepos;
829 if (! bfd_is_thin_archive (archive))
847 return _bfd_get_elt_at_filepos (archive, filestart);
851 _bfd_noarchive_openr_next_archived_file (bfd *archive,
854 return (bfd *) _bfd_ptr_bfd_null_error (archive);
914 /* This archive has a map, so we may presume that the contents
916 archive can be recognized as an object file, it is for this
922 normal archive, regardless of the format of the object files.
923 We do accept an empty archive. */
942 /* Some constants for a 32 bit BSD archive structure. We do not
959 /* Read a BSD-style archive symbol table. Returns FALSE on error,
1045 /* Read a COFF archive symbol table. Returns FALSE on error, TRUE
1074 /* It seems that all numeric information in a coff archive is always
1145 /* Check for a second archive header (as used by PE). */
1166 (archive symbol table). Returns FALSE on error, TRUE otherwise */
1189 /* 64bit (Irix 6) archive. */
1228 element (the first in the archive, or second if there is an armap);
1295 /* Since the archive is supposed to be printable if it contains
1298 trailing '/'. DOS/NT created archive often have \ in them
1572 /* If the element being added is a member of another archive
1573 (i.e., we are flattening), use the containing archive's name. */
1580 archive that contains other archives. */
1587 the containing archive. */
1594 /* In a thin archive, always store the full pathname
1665 /* If the element being added is a member of another archive
1666 (i.e., we are flattening), use the containing archive's name. */
1672 archive that contains other archives.
1674 the containing archive. */
1694 encounter an oddball archive format and want to
1772 /* Write an archive header. */
1775 _bfd_generic_write_ar_hdr (bfd *archive, bfd *abfd)
1779 if (bfd_bwrite (hdr, sizeof (*hdr), archive) != sizeof (*hdr))
1784 /* Write an archive header using BSD4.4 convention. */
1787 _bfd_bsd44_write_ar_hdr (bfd *archive, bfd *abfd)
1804 if (bfd_bwrite (hdr, sizeof (*hdr), archive) != sizeof (*hdr))
1807 if (bfd_bwrite (fullname, len, archive) != len)
1815 if (bfd_bwrite (pad, len, archive) != len)
1821 if (bfd_bwrite (hdr, sizeof (*hdr), archive) != sizeof (*hdr))
1828 _bfd_noarchive_write_ar_hdr (bfd *archive, bfd *abfd ATTRIBUTE_UNUSED)
1830 return _bfd_bool_bfd_false_error (archive);
2129 filesystem (as opposed to living in an archive open for input)
2136 from (which are usually either an object file or archive on
2137 disk), not the archive entries we're writing to. We don't
2138 actually create bfds for the archive members, we just copy
2139 them byte-wise when we write out the archive. */
2191 /* Round size up to even number in archive header. */
2245 /* Verify the timestamp in the archive file. If it would not be
2257 (_("warning: writing archive was slow: rewriting timestamp"));
2364 /* This symbol will go into the archive header. */
2478 /* The archive file format only has 4 bytes to store the offset
2479 of the member. Generate 64-bit archive if an archive is past
2491 Some linkers may require that the archive filesystem modification
2492 time is less than (or near to) the archive map timestamp. Those
2549 /* The archive file format only has 4 bytes to store the offset
2590 /* At the end of archive file handling, update the timestamp in the
2611 bfd_perror (_("Reading archive file mod timestamp"));
2667 archive * the number of bytes in an int, + an int for the count. */
2681 /* Work out where the first object file will go in the archive. */
2694 out the object file's address in the archive. */
2700 /* Generate 64-bit archive if an archive is past its 4Gb
2710 /* Add size of this archive entry. */
2752 out the object file's address in the archive. */
2758 /* Catch an attempt to grow an archive past its 4Gb limit. */
2771 /* Add size of this archive entry. */
2852 /* Close nested archives (if this bfd is a thin archive). */