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
246 Step through archive @var{abfd}'s symbol table (if it
255 A <<carsym>> is a canonical archive symbol. The only
296 BFDs contained in the archive @var{output} to @var{new_head}.
321 an archive, and checking for an archive means one element has
388 open_nested_file (const char *filename, bfd *archive)
394 if (!archive->target_defaulted)
395 target = archive->xvec->name;
399 n_bfd->lto_output = archive->lto_output;
400 n_bfd->no_export = archive->no_export;
401 n_bfd->my_archive = archive;
411 /* PR 15140: Don't allow a nested archive pointing to itself. */
453 /* In a thin archive, a member of an archive-within-an-archive
454 will have the offset in the inner archive encoded here. */
531 /* Extract the filename from the archive - there are two ways to
632 /* Append the relative pathname for a member of the thin archive
633 to the pathname of the directory containing the archive. */
657 through the archive symbol table, but also used to get the next
661 _bfd_get_elt_at_filepos (bfd *archive, file_ptr filepos,
668 n_bfd = _bfd_look_for_bfd_in_cache (archive, filepos);
672 if (0 > bfd_seek (archive, filepos, SEEK_SET))
675 if ((new_areldata = (struct areltdata *) _bfd_read_ar_hdr (archive)) == NULL)
680 if (bfd_is_thin_archive (archive))
685 filename = _bfd_append_relative_path (archive, filename);
695 /* This proxy entry refers to an element of a nested archive.
696 Locate the member of that archive and return a bfd for it. */
697 bfd *ext_arch = find_nested_archive (filename, archive);
712 n_bfd->proxy_origin = bfd_tell (archive);
716 n_bfd->flags |= archive->flags & (BFD_COMPRESS
723 /* It's not an element of a nested archive;
726 n_bfd = open_nested_file (filename, archive);
740 (_("%F%P: %pB(%s): error opening thin archive member: %E\n"),
741 archive, filename);
750 n_bfd = _bfd_create_empty_archive_element_shell (archive);
759 n_bfd->proxy_origin = bfd_tell (archive);
761 if (bfd_is_thin_archive (archive))
775 n_bfd->flags |= archive->flags & (BFD_COMPRESS
780 n_bfd->is_linker_input = archive->is_linker_input;
782 if (archive->no_element_cache
783 || _bfd_add_bfd_to_archive_cache (archive, filepos, n_bfd))
817 bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous);
820 Provided a BFD, @var{archive}, containing an archive and NULL, open
822 Subsequent calls should pass the archive and the previous return
830 bfd_openr_next_archived_file (bfd *archive, bfd *last_file)
832 if ((bfd_get_format (archive) != bfd_archive)
833 || (archive->direction == write_direction))
839 return BFD_SEND (archive,
840 openr_next_archived_file, (archive, last_file));
844 bfd_generic_openr_next_archived_file (bfd *archive, bfd *last_file)
849 filestart = bfd_ardata (archive)->first_file_filepos;
853 if (! bfd_is_thin_archive (archive))
871 return _bfd_get_elt_at_filepos (archive, filestart, NULL);
875 _bfd_noarchive_openr_next_archived_file (bfd *archive,
878 return (bfd *) _bfd_ptr_bfd_null_error (archive);
938 /* This archive has a map, so we may presume that the contents
940 archive can be recognized as an object file, it is for this
946 normal archive, regardless of the format of the object files.
947 We do accept an empty archive. */
966 /* Some constants for a 32 bit BSD archive structure. We do not
983 /* Read a BSD-style archive symbol table. Returns FALSE on error,
1069 /* Read a COFF archive symbol table. Returns FALSE on error, TRUE
1098 /* It seems that all numeric information in a coff archive is always
1169 /* Check for a second archive header (as used by PE). */
1190 (archive symbol table). Returns FALSE on error, TRUE otherwise */
1213 /* 64bit (Irix 6) archive. */
1252 element (the first in the archive, or second if there is an armap);
1319 /* Since the archive is supposed to be printable if it contains
1322 trailing '/'. DOS/NT created archive often have \ in them
1596 /* If the element being added is a member of another archive
1597 (i.e., we are flattening), use the containing archive's name. */
1604 archive that contains other archives. */
1611 the containing archive. */
1618 /* In a thin archive, always store the full pathname
1689 /* If the element being added is a member of another archive
1690 (i.e., we are flattening), use the containing archive's name. */
1696 archive that contains other archives.
1698 the containing archive. */
1718 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))
1852 _bfd_noarchive_write_ar_hdr (bfd *archive, bfd *abfd ATTRIBUTE_UNUSED)
1854 return _bfd_bool_bfd_false_error (archive);
2145 filesystem (as opposed to living in an archive open for input)
2152 from (which are usually either an object file or archive on
2153 disk), not the archive entries we're writing to. We don't
2154 actually create bfds for the archive members, we just copy
2155 them byte-wise when we write out the archive. */
2207 /* Round size up to even number in archive header. */
2272 /* Verify the timestamp in the archive file. If it would not be
2284 (_("warning: writing archive was slow: rewriting timestamp"));
2391 /* This symbol will go into the archive header. */
2506 /* The archive file format only has 4 bytes to store the offset
2507 of the member. Generate 64-bit archive if an archive is past
2519 Some linkers may require that the archive filesystem modification
2520 time is less than (or near to) the archive map timestamp. Those
2585 /* The archive file format only has 4 bytes to store the offset
2626 /* At the end of archive file handling, update the timestamp in the
2647 bfd_perror (_("Reading archive file mod timestamp"));
2703 archive * the number of bytes in an int, + an int for the count. */
2717 /* Work out where the first object file will go in the archive. */
2730 out the object file's address in the archive. */
2736 /* Generate 64-bit archive if an archive is past its 4Gb
2746 /* Add size of this archive entry. */
2788 out the object file's address in the archive. */
2794 /* Catch an attempt to grow an archive past its 4Gb limit. */
2807 /* Add size of this archive entry. */
2888 /* Close nested archives (if this bfd is a thin archive). */
2903 /* Close the archive plugin file descriptor if needed. */