#include "bfd.h"#include "sysdep.h"#include "libbfd.h"#include "aout/ar.h"#include "aout/ranlib.h"#include "safe-ctype.h"

Go to the source code of this file.
Definition at line 158 of file archive.c.
Referenced by _bfd_generic_read_ar_hdr_mag(), bfd_bsd_truncate_arname(), bfd_dont_truncate_arname(), and bfd_gnu_truncate_arname().
Definition at line 157 of file archive.c.
Referenced by _bfd_construct_extended_name_table(), bfd_bsd_truncate_arname(), bfd_dont_truncate_arname(), and bfd_gnu_truncate_arname().
Definition at line 160 of file archive.c.
Referenced by _bfd_xcoff_stat_arch_elt(), bfd_generic_stat_arch_elt(), xcoff_write_archive_contents_big(), and xcoff_write_archive_contents_old().
Definition at line 161 of file archive.c.
Referenced by _bfd_construct_extended_name_table(), _bfd_write_archive_contents(), bfd_generic_stat_arch_elt(), extract_archive_member(), ipa_process_whirl_in_archive(), and load_symbols().
| #define BSD_STRING_COUNT_SIZE 4 |
Definition at line 666 of file archive.c.
Referenced by bfd_slurp_bsd_armap_f2(), and do_slurp_bsd_armap().
| #define BSD_SYMDEF_COUNT_SIZE 4 |
| #define BSD_SYMDEF_OFFSET_SIZE 4 |
Definition at line 660 of file archive.c.
Referenced by bfd_slurp_bsd_armap_f2(), bsd_write_armap(), and do_slurp_bsd_armap().
| #define BSD_SYMDEF_SIZE 8 |
Definition at line 657 of file archive.c.
Referenced by bfd_slurp_bsd_armap_f2(), bsd_write_armap(), and do_slurp_bsd_armap().
Referenced by bfd_generic_stat_arch_elt().
| #define getgid | ( | void | ) | 0 |
Definition at line 1312 of file archive.c.
Referenced by _PXFGETGID(), bfd_ar_hdr_from_filesystem(), bsd_write_armap(), and getgid_().
| #define getuid | ( | void | ) | 0 |
Definition at line 1308 of file archive.c.
Referenced by _PXFGETUID(), bfd_ar_hdr_from_filesystem(), bsd_write_armap(), and getuid_().
| #define HPUX_SYMDEF_COUNT_SIZE 2 |
Definition at line 267 of file archive.c.
References ar_cache::arelt, bfd_ardata, bfd_zalloc(), FALSE, ar_cache::next, NULL, ar_cache::ptr, and TRUE.
Referenced by _bfd_get_elt_at_filepos().
| bfd_boolean _bfd_archive_bsd_construct_extended_name_table | ( | bfd * | abfd, | |
| char ** | tabloc, | |||
| bfd_size_type * | tablen, | |||
| const char ** | name | |||
| ) |
Definition at line 1148 of file archive.c.
References _bfd_construct_extended_name_table(), and FALSE.
| bfd_boolean _bfd_archive_bsd_update_armap_timestamp | ( | bfd * | arch | ) |
Definition at line 1985 of file archive.c.
References _, ar_hdr::ar_date, ARMAP_TIME_OFFSET, bfd_ardata, bfd_bwrite(), bfd_flush(), bfd_perror(), bfd_seek(), bfd_stat(), FALSE, i, memset, offsetof, SARMAG, SEEK_SET, sprintf(), stat::st_mtime, and TRUE.
| bfd_boolean _bfd_archive_coff_construct_extended_name_table | ( | bfd * | abfd, | |
| char ** | tabloc, | |||
| bfd_size_type * | tablen, | |||
| const char ** | name | |||
| ) |
Definition at line 1160 of file archive.c.
References _bfd_construct_extended_name_table(), and TRUE.
| bfd_boolean _bfd_compute_and_write_armap | ( | bfd * | arch, | |
| unsigned int | elength | |||
| ) |
Definition at line 1744 of file archive.c.
References orl::abfd, bfd::archive_head, bfd_alloc(), bfd_canonicalize_symtab, bfd_check_format(), bfd_free_cached_info, bfd_get_file_flags, bfd_get_symtab_upper_bound, bfd_is_com_section, bfd_is_und_section, bfd_malloc(), bfd_object, bfd_realloc(), bfd_release(), BFD_SEND, BSF_GLOBAL, BSF_INDIRECT, BSF_WEAK, FALSE, bfd::filename, flags, free(), HAS_SYMS, map, orl::name, orl::namidx, bfd::next, NULL, ret, sec, bfd_symbol::section, storage, strcmp(), strcpy, strlen(), symcount, and orl::u.
Referenced by _bfd_write_archive_contents(), xcoff_write_archive_contents_big(), and xcoff_write_archive_contents_old().
| bfd_boolean _bfd_construct_extended_name_table | ( | bfd * | abfd, | |
| bfd_boolean | trailing_slash, | |||
| char ** | tabloc, | |||
| bfd_size_type * | tablen | |||
| ) |
Definition at line 1178 of file archive.c.
References bfd_target::ar_max_namelen, ar_hdr::ar_name, ar_padchar, arch_hdr, bfd::archive_head, bfd_get_file_flags, BFD_TRADITIONAL_FORMAT, bfd_zalloc(), FALSE, bfd::filename, memcpy, bfd::next, normal, normalize(), NULL, sprintf(), strcpy, strlen(), strncmp(), TRUE, and bfd::xvec.
Referenced by _bfd_archive_bsd_construct_extended_name_table(), _bfd_archive_coff_construct_extended_name_table(), and _bfd_write_archive_contents().
Definition at line 227 of file archive.c.
References _bfd_new_bfd_contained_in().
Referenced by _bfd_get_elt_at_filepos(), ieee_openr_next_archived_file(), and oasys_openr_next_archived_file().
Definition at line 510 of file archive.c.
References _bfd_get_elt_at_filepos(), bfd_ardata, and carsym::file_offset.
Referenced by vms_get_elt_at_index().
| bfd_boolean _bfd_generic_mkarchive | ( | bfd * | abfd | ) |
Definition at line 165 of file archive.c.
References bfd::aout_ar_data, bfd_ardata, bfd_zalloc(), FALSE, NULL, bfd::tdata, and TRUE.
Definition at line 332 of file archive.c.
References ar_hdr::ar_fmag, ar_maxnamelen, ar_hdr::ar_name, ar_hdr::ar_size, areltdata::arch_header, ARFMAG, atoi(), bfd_ardata, bfd_bread(), bfd_error_malformed_archive, bfd_error_no_more_archived_files, bfd_error_system_call, bfd_get_error(), bfd_set_error(), bfd_zalloc(), errno, filename, areltdata::filename, get_extended_arelt_filename(), ISDIGIT, memchr(), memcpy, NULL, areltdata::parsed_size, strncmp(), and strtol().
Referenced by _bfd_generic_read_ar_hdr(), and alpha_ecoff_read_ar_hdr().
Definition at line 465 of file archive.c.
References _bfd_add_bfd_to_archive_cache(), _bfd_create_empty_archive_element_shell(), _bfd_look_for_bfd_in_cache(), _bfd_read_ar_hdr, bfd::arelt_data, bfd_release(), bfd_seek(), bfd_tell(), areltdata::filename, bfd::filename, bfd::my_archive, NULL, bfd::origin, and SEEK_SET.
Referenced by _bfd_generic_get_elt_at_index(), _bfd_xcoff_openr_next_archived_file(), alpha_ecoff_get_elt_at_filepos(), bfd_generic_openr_next_archived_file(), elf_link_add_archive_symbols(), elf_link_is_defined_archive_symbol(), and xcoff64_openr_next_archived_file().
Definition at line 252 of file archive.c.
References ar_cache::arelt, bfd_ardata, ar_cache::next, NULL, and ar_cache::ptr.
Referenced by _bfd_get_elt_at_filepos().
| bfd_boolean _bfd_slurp_extended_name_table | ( | bfd * | abfd | ) |
Extended name table.
Normally archives support only 14-character filenames.
Intel has extended the format: longer names are stored in a special element (the first in the archive, or second if there is an armap); the name in the ar_hdr is replaced by <space><index into="" filename="" element>="">. Index is the P.R. of an int (decimal). Data General have extended the format by using the prefix // for the special element.
Definition at line 1013 of file archive.c.
References _bfd_read_ar_hdr, bfd_ardata, bfd_bread(), bfd_error_malformed_archive, bfd_error_system_call, bfd_get_error(), bfd_release(), bfd_seek(), bfd_set_error(), bfd_tell(), bfd_zalloc(), FALSE, NULL, areltdata::parsed_size, SEEK_CUR, SEEK_SET, strncmp(), and TRUE.
Referenced by bfd_generic_archive_p().
| bfd_boolean _bfd_write_archive_contents | ( | bfd * | arch | ) |
Definition at line 1597 of file archive.c.
References _, _bfd_compute_and_write_armap(), _bfd_construct_extended_name_table(), ar_hdr::ar_fmag, ar_hdr::ar_name, ar_hdr::ar_size, arch_hdr, bfd::archive_head, bfd::arelt_data, arelt_size, ARFMAG, ARMAG, bfd_ar_hdr_from_filesystem(), bfd_bread(), bfd_bwrite(), bfd_check_format(), bfd_error_invalid_operation, bfd_error_malformed_archive, bfd_error_system_call, bfd_get_error(), bfd_has_map, bfd_object, bfd_seek(), BFD_SEND, bfd_set_error(), bfd_update_armap_timestamp, bfd_write_p, DEFAULT_BUFFERSIZE, errno, FALSE, bfd::filename, i, memset, bfd::next, NULL, SARMAG, SEEK_SET, sprintf(), strcpy, strncpy(), and TRUE.
| static struct areltdata* bfd_ar_hdr_from_filesystem | ( | bfd * | abfd, | |
| const char * | filename, | |||
| bfd * | member | |||
| ) | [static, read] |
Definition at line 1321 of file archive.c.
References ar_hdr::ar_date, ar_hdr::ar_fmag, ar_hdr::ar_gid, ar_hdr::ar_mode, ar_hdr::ar_size, ar_hdr::ar_uid, ARFMAG, bfd_error_system_call, BFD_IN_MEMORY, bfd_set_error(), bfd_zalloc(), bfd::flags, getgid, getuid, bfd::iostream, memset, NULL, bfd_in_memory::size, sprintf(), stat::st_gid, stat::st_mode, stat::st_mtime, stat::st_size, stat::st_uid, strncpy(), and time.
Referenced by _bfd_write_archive_contents(), and bfd_special_undocumented_glue().
Definition at line 1504 of file archive.c.
References ar_maxnamelen, ar_hdr::ar_name, ar_padchar, filename, length, memcpy, NULL, strlen(), and strrchr().
Referenced by bfd_dont_truncate_arname().
Definition at line 1467 of file archive.c.
References abort, ar_maxnamelen, ar_hdr::ar_name, ar_padchar, bfd_bsd_truncate_arname(), bfd_get_file_flags, BFD_TRADITIONAL_FORMAT, filename, length, memcpy, normalize(), NULL, and strlen().
| const bfd_target* bfd_generic_archive_p | ( | bfd * | abfd | ) |
Definition at line 571 of file archive.c.
References _bfd_slurp_extended_name_table(), ARMAG, ARMAGB, bfd_ardata, bfd_bread(), bfd_check_format(), bfd_error_system_call, bfd_error_wrong_format, bfd_error_wrong_object_format, bfd_get_error(), bfd_has_map, bfd_object, bfd_openr_next_archived_file(), bfd_release(), BFD_SEND, bfd_set_error(), bfd_zalloc(), fail, FALSE, first, NULL, SARMAG, strncmp(), bfd::target_defaulted, and bfd::xvec.
Definition at line 549 of file archive.c.
References _bfd_get_elt_at_filepos(), arelt_size, bfd_ardata, bfd::my_archive, bfd::origin, and size.
Definition at line 1412 of file archive.c.
References ar_hdr::ar_date, ar_hdr::ar_gid, ar_hdr::ar_mode, ar_hdr::ar_uid, arch_eltdata, arch_hdr, bfd::arelt_data, bfd_error_invalid_operation, bfd_set_error(), foo2, NULL, and stat::st_size.
Referenced by vms_generic_stat_arch_elt().
Definition at line 205 of file archive.c.
References bfd_ardata, bfd_error_invalid_operation, bfd_has_map, BFD_NO_MORE_SYMBOLS, bfd_set_error(), and artdata::symdef_count.
Definition at line 1552 of file archive.c.
References ar_maxnamelen, ar_hdr::ar_name, ar_padchar, filename, length, memcpy, NULL, strlen(), and strrchr().
Definition at line 535 of file archive.c.
References bfd_archive, bfd_error_invalid_operation, bfd_get_format, BFD_SEND, bfd_set_error(), bfd::direction, and NULL.
Referenced by _bfd_ecoff_archive_p(), _bfd_generic_link_add_archive_symbols(), _bfd_xcoff_bfd_link_add_symbols(), bfd_generic_archive_p(), ecoff_link_add_archive_symbols(), elf_link_add_archive_symbols(), ldfile_try_open_bfd(), load_symbols(), walk_wild_file(), and xcoff_build_ldsyms().
Definition at line 245 of file archive.c.
References bfd::archive_head, and TRUE.
Referenced by pe_dll_generate_implib().
| bfd_boolean bfd_slurp_armap | ( | bfd * | abfd | ) |
Definition at line 863 of file archive.c.
References bfd_bread(), bfd_elf64_archive_slurp_armap(), bfd_error_wrong_format, bfd_has_map, bfd_seek(), bfd_set_error(), do_slurp_bsd_armap(), do_slurp_coff_armap(), FALSE, i, SEEK_CUR, strncmp(), and TRUE.
Referenced by _bfd_ecoff_slurp_armap(), and bfd_elf64_archive_slurp_armap().
| bfd_boolean bfd_slurp_bsd_armap_f2 | ( | bfd * | abfd | ) |
Definition at line 905 of file archive.c.
References _bfd_read_ar_hdr, bfd_alloc(), bfd_ardata, bfd_bread(), bfd_error_malformed_archive, bfd_error_system_call, bfd_error_wrong_format, bfd_get_error(), bfd_has_map, bfd_release(), bfd_seek(), bfd_set_error(), bfd_tell(), bfd_zalloc(), BSD_STRING_COUNT_SIZE, BSD_SYMDEF_OFFSET_SIZE, BSD_SYMDEF_SIZE, artdata::cache, do_slurp_bsd_armap(), FALSE, artdata::first_file_filepos, H_GET_16, H_GET_32, HPUX_SYMDEF_COUNT_SIZE, i, NULL, areltdata::parsed_size, SEEK_CUR, strncmp(), artdata::symdef_count, artdata::symdefs, and TRUE.
Definition at line 1401 of file archive.c.
References areltdata::arch_header, bfd_ar_hdr_from_filesystem(), and NULL.
| bfd_boolean bsd_write_armap | ( | bfd * | arch, | |
| unsigned int | elength, | |||
| struct orl * | map, | |||
| unsigned int | orl_count, | |||
| int | stridx | |||
| ) |
Definition at line 1888 of file archive.c.
References orl::abfd, ar_hdr::ar_date, ar_hdr::ar_fmag, ar_hdr::ar_gid, ar_hdr::ar_name, ar_hdr::ar_size, ar_hdr::ar_uid, bfd::archive_head, arelt_size, ARFMAG, ARMAP_TIME_OFFSET, bfd_ardata, bfd_bwrite(), BSD_SYMDEF_OFFSET_SIZE, BSD_SYMDEF_SIZE, buf, count, FALSE, bfd::filename, getgid, getuid, H_PUT_32, i, len, mapsize, memset, bfd::next, offsetof, RANLIBMAG, sprintf(), stat::st_mtime, stat, strlen(), strncpy(), and TRUE.
| bfd_boolean coff_write_armap | ( | bfd * | arch, | |
| unsigned int | elength, | |||
| struct orl * | map, | |||
| unsigned int | symbol_count, | |||
| int | stridx | |||
| ) |
Definition at line 2046 of file archive.c.
References orl::abfd, ar_hdr::ar_date, ar_hdr::ar_fmag, ar_hdr::ar_gid, ar_hdr::ar_mode, ar_hdr::ar_name, ar_hdr::ar_size, ar_hdr::ar_uid, bfd::archive_head, arelt_size, ARFMAG, bfd_bwrite(), bfd_write_bigendian_4byte_int(), count, FALSE, i, len, mapsize, memset, bfd::next, NULL, sprintf(), strlen(), strncpy(), time, and TRUE.
| static bfd_boolean do_slurp_bsd_armap | ( | bfd * | abfd | ) | [static] |
Definition at line 671 of file archive.c.
References _bfd_read_ar_hdr, bfd_alloc(), bfd_ardata, bfd_bread(), bfd_error_malformed_archive, bfd_error_system_call, bfd_error_wrong_format, bfd_get_error(), bfd_has_map, bfd_release(), bfd_set_error(), bfd_tell(), bfd_zalloc(), BSD_STRING_COUNT_SIZE, BSD_SYMDEF_COUNT_SIZE, BSD_SYMDEF_OFFSET_SIZE, BSD_SYMDEF_SIZE, artdata::cache, FALSE, artdata::first_file_filepos, H_GET_32, NULL, areltdata::parsed_size, artdata::symdef_count, artdata::symdefs, and TRUE.
Referenced by bfd_slurp_armap(), and bfd_slurp_bsd_armap_f2().
| static bfd_boolean do_slurp_coff_armap | ( | bfd * | abfd | ) | [static] |
Definition at line 741 of file archive.c.
References _bfd_read_ar_hdr, areltdata::arch_header, bfd_alloc(), bfd_arch_i960, bfd_ardata, bfd_bread(), bfd_error_malformed_archive, bfd_error_system_call, bfd_get_arch(), bfd_get_error(), bfd_get_flavour, bfd_getb32(), bfd_getl32(), bfd_has_map, bfd_release(), bfd_seek(), bfd_set_error(), bfd_target_coff_flavour, bfd_tell(), bfd_zalloc(), FALSE, carsym::file_offset, artdata::first_file_filepos, i, long, carsym::name, NULL, areltdata::parsed_size, rawptr, SEEK_SET, strlen(), swap(), artdata::symdef_count, artdata::symdefs, tmp, TRUE, and unsigned.
Referenced by bfd_slurp_armap().
| static char* get_extended_arelt_filename | ( | bfd * | arch, | |
| const char * | name | |||
| ) | [static] |
Definition at line 296 of file archive.c.
References bfd_ardata, bfd_error_malformed_archive, bfd_set_error(), errno, index(), NULL, and strtol().
Referenced by _bfd_generic_read_ar_hdr_mag().
Definition at line 1123 of file archive.c.
References filename, NULL, and strrchr().
Referenced by _bfd_construct_extended_name_table(), bfd_dont_truncate_arname(), decode_i370_double(), decode_i370_single(), decode_ieee_double(), decode_ieee_extended(), decode_ieee_quad(), decode_ieee_single(), do_add(), do_divide(), do_multiply(), encode_ibm_extended(), noce_try_addcc(), noce_try_store_flag_constants(), noce_try_store_flag_inc(), real_convert(), real_from_integer(), real_from_string(), rtd_divmod(), sreal_add(), sreal_div(), sreal_init(), sreal_mul(), and sreal_sub().
| int errno |
1.5.6