summaryrefslogtreecommitdiff
path: root/bfd/cache.c
Commit message (Collapse)AuthorAgeFilesLines
* bfd: Make bfd_cache_max_open depend on actual open file limit.Mark Wielaard2013-05-271-6/+32
| | | | | | | | | | | | | | | | | | | | | | The current hard coded limit of open files in bfd/cache.c is 10. This is pretty low these days. Binaries are often linked against much more than 10 files (and sometimes against more than 100 shared libraries). When debugging with GDB some files are opened and closed multiple times because of this low limit. If possible make the BFD cache file limit depend on the actual open file limit of the process so more BFD files can be open at the same time. * cache.c (BFD_CACHE_MAX_OPEN): Remove define. (max_open_files): New static int initialized to zero. (bfd_cache_max_open): New static function to set and return max_open_files. (bfd_cache_init): Use bfd_cache_max_open. (bfd_open_file): Likewise. * configure.in (AC_CHECK_HEADERS): Add sys/resource.h. (AC_CHECK_FUNCS): Add getrlimit. * configure: Regenerated. * config.in: Likewise. * sysdep.h: Check and include sys/resource.h for getrlimit.
* PR binutils/14813Alan Modra2013-01-141-2/+2
| | | | | | | | | * bfdio.c (struct bfd_iovec <bclose>): Revert 2012-11-06. (memory_bclose): Likewise. Return 0 on success. * cache.c (cache_bclose): Likewise. * opncls.c (opncls_bclose, bfd_close): Likewise. * vms-lib.c (vms_lib_bclose): Likewise. * libbfd.h: Regenerate.
* Change return type of bclose to bfd_booleanH.J. Lu2012-11-071-1/+1
| | | | | | | | | | | PR binutils/14813 * bfdio.c (bfd_iovec): Change return type of bclose to bfd_boolean. (memory_bclose): Change return type to bfd_boolean. * cache.c (cache_bclose): Likewise. * opncls.c (opncls_bclose): Likewise. Return TRUE on success. * vms-lib.c (vms_lib_bclose): Likewise. Return TRUE. * libbfd.h: Regenerated.
* * cache.c (cache_bmmap): Don't use void* arithmetic.Alan Modra2012-10-221-1/+1
|
* * aix386-core.c: Remove use of PTR and PARAMS macros.Nick Clifton2012-07-131-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * archive.c: Likewise. * cache.c: Likewise. * cisco-core.c: Likewise. * coff-alpha.c: Likewise. * coff-apollo.c: Likewise. * coff-aux.c: Likewise. * coff-h8300.c: Likewise. * coff-h8500.c: Likewise. * coff-i386.c: Likewise. * coff-i960.c: Likewise. * coff-ia64.c: Likewise. * coff-m68k.c: Likewise. * coff-m88k.c: Likewise. * coff-mcore.c: Likewise. * coff-mips.c: Likewise. * coff-or32.c: Likewise. * coff-ppc.c: Likewise. * coff-rs6000.c: Likewise. * coff-sh.c: Likewise. * coff-sparc.c: Likewise. * coff-stgo32.c: Likewise. * coff-tic30.c: Likewise. * coff-tic4x.c: Likewise. * coff-tic54x.c: Likewise. * coff-tic80.c: Likewise. * coff-w65.c: Likewise. * cofflink.c: Likewise. * cpu-arc.c: Likewise. * cpu-cris.c: Likewise. * cpu-h8500.c: Likewise. * cpu-i960.c: Likewise. * cpu-msp430.c: Likewise. * cpu-ns32k.c: Likewise. * cpu-powerpc.c: Likewise. * cpu-rs6000.c: Likewise. * cpu-tic4x.c: Likewise. * cpu-w65.c: Likewise. * ecoff.c: Likewise. * ecofflink.c: Likewise. * elf-m10200.c: Likewise. * elf32-bfin.c: Likewise. * elf32-cris.c: Likewise. * elf32-crx.c: Likewise. * elf32-fr30.c: Likewise. * elf32-frv.c: Likewise. * elf32-h8300.c: Likewise. * elf32-i960.c: Likewise. * elf32-m32c.c: Likewise. * elf32-m68hc11.c: Likewise. * elf32-m68hc12.c: Likewise. * elf32-m68hc1x.c: Likewise. * elf32-m68k.c: Likewise. * elf32-mcore.c: Likewise. * elf32-rl78.c: Likewise. * elf32-rx.c: Likewise. * elf32-s390.c: Likewise. * elf32-vax.c: Likewise. * elf64-alpha.c: Likewise. * elf64-mmix.c: Likewise. * elf64-s390.c: Likewise. * elf64-sparc.c: Likewise. * elfnn-ia64.c: Likewise. * elfxx-mips.c: Likewise. * elfxx-sparc.c: Likewise. * hash.c: Likewise. * hp300hpux.c: Likewise. * hppabsd-core.c: Likewise. * hpux-core.c: Likewise. * i386dynix.c: Likewise. * i386linux.c: Likewise. * i386lynx.c: Likewise. * i386mach3.c: Likewise. * i386msdos.c: Likewise. * i386os9k.c: Likewise. * irix-core.c: Likewise. * lynx-core.c: Likewise. * m68klinux.c: Likewise. * mach-o.h: Likewise. * mipsbsd.c: Likewise. * netbsd-core.c: Likewise. * nlm32-i386.c: Likewise. * osf-core.c: Likewise. * pc532-mach.c: Likewise. * pef.c: Likewise. * ppcboot.c: Likewise. * ptrace-core.c: Likewise. * reloc16.c: Likewise. * sco5-core.c: Likewise. * som.h: Likewise. * sparclinux.c: Likewise. * sparclynx.c: Likewise. * ticoff.h: Likewise. * trad-core.c: Likewise. * vms-lib.c: Likewise. * xsym.h: Likewise.
* 2012-01-10 Tristan Gingold <gingold@adacore.com>Tristan Gingold2012-01-101-1/+1
| | | | | | | | | * bfdio.c (bfd_tell): Handle nested archives. (bfd_seek): Ditto. * cache.c (bfd_cache_lookup_worker): Ditto. * archive.c (_bfd_get_elt_at_filepos): Remove code dealing with nested archives. (bfd_generic_openr_next_archived_file): Likewise.
* 2011-06-27 Tristan Gingold <gingold@adacore.com>Tristan Gingold2011-06-271-3/+28
| | | | | | | | | | | | * cache.c: Include bfd_stdint.h. (cache_bmmap): Change profile. Return region start and size. * bfdio.c (struct bfd_iovec): Change bmmap profile. (bfd_mmap): Change profile and adjust. Update comment. (memory_bmmap): Change profile. * opncls.c (opncls_bmmap): Change profile. * vms-lib.c (vms_lib_bmmap): Likewise. * libbfd.h: Regenerate. * bfd-in2.h: Regenerate.
* 2009-12-11 Tristan Gingold <gingold@adacore.com>Tristan Gingold2009-12-111-10/+10
| | | | | | | * som.c (bfd_som_set_subsection_attributes) (bfd_section_from_som_symbol, som_reloc_queue_fix): Fix shadowed variable warnings. * cache.c (close_one): Likewise.
* Updated soruces in bfd/* to compile cleanly with -Wc++-compat.Nick Clifton2009-09-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bfd/aoutx.h: Add casts. * bfd/archive.c: Add casts. * bfd/archive64.c: Add casts. * bfd/archures.c: Add casts. * bfd/bfd-in2.h: Regenerated. * bfd/bfd.c: Add casts. (enum bfd_direction): Move out to top level. * bfd/bfdio.c: Add casts. * bfd/binary.c: Add casts. * bfd/cache.c (cache_bseek,cache_bread_1,cache_bwrite): Updated parameter to use enum value instead of int. * bfd/coffcode.h: Add casts. * bfd/coffgen.c: Add casts. * bfd/cofflink.c: Add casts. * bfd/compress.c: Add casts. * bfd/dwarf1.c: Add casts. * bfd/dwarf2.c: Add casts. (struct dwarf2_debug): Rename member bfd to bfd_ptr. Update code to use new name. * bfd/elf-attrs.c: Add casts. * bfd/elf-bfd.h (elf_link_virtual_table_entry): Gives name to anonymous struct. (union gotplt_union, struct elf_link_virtual_table_entry): Move to top level. * bfd/elf-eh-frame.c: Add casts. * bfd/elf-strtab.c: Add casts. * bfd/elf.c: Add casts. (_bfd_elm_make_Section_from_phdr): Change argument name from typename to type_name. * bfd/elf32-i386.c: Add casts. * bfd/elf64-x86-64.c: Add casts. * bfd/elfcode.h: Add casts. * bfd/elfcore.h: Add casts. * bfd/elflink.c: Add casts. * bfd/format.c: Add casts. * bfd/hash.c: Add casts. * bfd/ihex.c: Add casts. * bfd/libaout.h (enum aout_subformat, enum aout_magic): Move to top level. * bfd/libbfd.c: Add casts. * bfd/linker.c: Add casts. * bfd/merge.c: Add casts. * bfd/opncls.c: Add casts. * bfd/peXXigen.c: Add casts. * bfd/peicode.h: Add casts. * bfd/reloc.c: Add casts. * bfd/section.c: Add casts. * bfd/simple.c: Add casts. * bfd/srec.c: Add casts. * bfd/stabs.c: Add casts. * bfd/syms.c: Add casts. * bfd/targets.c: Add casts. * bfd/tekhex.c: Add casts. * bfd/verilog.c: Add casts. * include/bfdlink.h (struct bfd_link_hash_common_entry): Move to top level.
* update copyright datesAlan Modra2009-09-021-1/+1
|
* 2009-06-10 Paul Pluzhnikov <ppluzhnikov@google.com>Paul Pluzhnikov2009-06-111-1/+33
| | | | | | | | | | * bfd-in2.h: bfd_mmap prototype * bfdio.c (bfd_mmap): New function. * libbfd.h (bfd_iovec): Add bmmap. * cache.c (cache_bmap): New function. (cache_iovec): Initialize bmmap member. * opencls.c (opncls_bmmap): New function. (opncls_iovec): Initialize bmmap member.
* * cache.c (cache_bread): Cast void * pointer before performingNick Clifton2008-10-301-2/+6
| | | | arithmetic on it.
* * cache.c (cache_bread_1): Renames cache_bread.Joel Brobecker2008-05-011-1/+38
| | | | (cache_bread): New function.
* * cache.c (close_one): Remove mtime hack.Daniel Jacobowitz2008-03-141-16/+0
| | | | | | | | | * corefile.c (reopen_exec_file): Use exec_bfd_mtime. * exec.c (exec_bfd_mtime): Define. (exec_close): Clear it. (exec_file_attach): Set it. * gdbcore.h (exec_bfd_mtime): Declare. * source.c (find_source_lines): Do not use bfd_get_mtime.
* * cache.c (cache_bread): Set bfd_error_file_truncated if EOFDaniel Jacobowitz2008-02-111-0/+4
| | | | | was reached. * srec.c (srec_scan): Calculate the checksum. Complain on mismatch.
* Switch sources over to use the GPL version 3Nick Clifton2007-07-031-15/+16
|
* bfd/Alan Modra2007-04-261-2/+2
| | | | | | | | | | | | | | | | | | | | Many files: Include sysdep.h before bfd.h. * Makefile.am: Run "make dep-am". * Makefile.in: Regenerate. binutils/ * bucumm.h: Split off host dependencies to.. * sysdep.h: ..here. Many files: Include sysdep.h. Remove duplicate headers and reorder. * Makefile.am: Run "make dep-am". * Makefile.in: Regenerate. ld/ Many files: Include sysdep.h first. Remove duplicate headers. * Makefile.am: Run "make dep-am". * Makefile.in: Regenerate. opcodes/ * Makefile.am: Run "make dep-am". * Makefile.in: Regenerate. * ns32k-dis.c: Include sysdep.h first.
* * configure.in: Check for fopen64.Daniel Jacobowitz2005-11-031-4/+4
| | | | | | | | * libbfd-in.h (real_fopen): New prototype. * configure, config.in, libbfd.h: Regenerated. * bfdio.c (real_fopen): New function. * opncls.c (bfd_fopen, bfd_fill_in_gnu_debuglink_section): Use it. * cache.c (bfd_open_file): Likewise.
* PR 973Alan Modra2005-10-271-12/+48
| | | | | | | | | | | | * cache.c (enum cache_flag): New. (close_one): Save file mtime. (bfd_cache_lookup): Add flag arg, adjust all users. (bfd_cache_lookup_worker): Likewise. (cache_btell): Use CACHE_NO_OPEN and return abfd->where if file not open. (cache_bflush): Similarly, and return success of file not open. (cache_bseek): Use CACHE_NO_SEEK if SEEK_SET or SEEK_END. (cache_bstat): Use CACHE_NO_SEEK_ERROR.
* * cache.c (BFD_CACHE_MAX_OPEN): Make private to this file.Alan Modra2005-10-271-55/+23
| | | | | | (bfd_last_cache, bfd_cache_lookup, bfd_cache_lookup_worker): Likewise. * libbfd-in.h (bfd_cache_lookup_worker, bfd_last_cache): Delete. * libbfd.h: Regenerate.
* * cache.c: Reorganize file to avoid forward reference.Alan Modra2005-10-271-191/+188
|
* * cache.c (bfd_cache_lookup_worker): Don't abort on failing toAlan Modra2005-10-261-12/+34
| | | | | | | | | | | reopen file. (cache_btell, cache_bseek, cache_bflush, cache_bstat): Return -1 on bfd_cache_lookup failure. (cache_bread, cache_bwrite): Return 0 on the same. * bfdwin.c (bfd_get_file_window): Likewise. * hppabsd-core.c (hppabsd_core_core_file_p): Likewise. * sco5-core.c (sco5_core_file_p): Likewise. * trad-core.c (trad_unix_core_file_p): Likewise.
* * cache.c (bfd_cache_lookup_worker): Use bfd_error_handlerAlan Modra2005-10-261-1/+3
| | | | rather than bfd_perror. Print file name. Internationalise.
* * cache.c (bfd_open_file): Set bfd_error_system_call on failureAlan Modra2005-10-261-8/+13
| | | | | | to open file. (bfd_cache_lookup_worker): Remove check that file pos is in unsigned long range. Print system error before aborting.
* * archive.c: Add missing SUBSECTION for documentation.Bob Wilson2005-10-051-0/+2
| | | | | | | | | | | | * bfd.c: Likewise. * cache.c: Likewise. * corefile.c: Likewise. * format.c: Likewise. * init.c: Likewise. * libbfd.c: Likewise. * opncls.c: Likewise. * elf.c: Remove blank line after SECTION heading. * reloc.c: Change "howto manager" SECTION to a SUBSECTION.
* (bfd_last_cache): Initialise to NULL.Nick Clifton2005-07-141-1/+1
|
* Update the address and phone number of the FSF organization in the GPL noticesNick Clifton2005-05-041-1/+1
|
* Update the FSF address in the copyright/GPL noticeNick Clifton2005-05-041-1/+1
|
* bfd/Jan Beulich2005-03-021-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | 2005-03-02 Jan Beulich <jbeulich@novell.com> * Makefile.am: Add dependency of cache.o on libiberty.h. * cache.c: Include libiberty.h. (bfd_open_file): Use unlink_if_ordinary instead of unlink. binutils/ 2005-03-02 Jan Beulich <jbeulich@novell.com> * ar.c (remove_output): Use unlink_if_ordinary instead of unlink. * objcopy.c (copy_file): Likewise. (strip_main): Likewise. gas/ 2005-03-02 Jan Beulich <jbeulich@novell.com> * as.c (main): Use unlink_if_ordinary instead of unlink. * messages.c (as_fatal): Likewise. ld/ 2005-03-02 Jan Beulich <jbeulich@novell.com> * ldmain.c (remove_output): Use unlink_if_ordinary instead of unlink. * pe-dll.c (pe_dll_generate_implib): Likewise.
* cache.c (bfd_cache_close_all): Add missing return statement.Jerome Guitton2004-06-171-0/+2
|
* * bfd-in.h (bfd_cache_close_all): New function declaration.Jerome Guitton2004-06-171-0/+25
| | | | | * bfd-in2.h: Regenerate. * cache.c (bfd_cache_close_all): New function definition.
* PR/136 - Have bfd_cache_lookup_worker() abort rather than return anNick Clifton2004-05-051-10/+9
| | | | (unchecked-for) NULL.
* 2004-04-22 Andrew Cagney <cagney@redhat.com>Andrew Cagney2004-04-221-0/+4
| | | | * cache.c (bfd_cache_close): Check for a previously closed file.
* 2004-04-21 Andrew Cagney <cagney@redhat.com>Andrew Cagney2004-04-211-2/+105
| | | | | | | | | | | | | | | | | | | | | * opncls.c (_bfd_new_bfd_contained_in): Copy "iovec". (struct opncls, opncls_btell, opncls_bseek, opncls_bread) (opncls_bwrite, opncls_bclose, opncls_bflush) (opncls_bstat, opncls_iovec, bfd_openr_iovec): Implement a bfd iovec that uses function callbacks. (bfd_close): Use the iovec's bclose. * cache.c (cache_btell, cache_bseek, cache_bread, cache_bwrite) (cache_bclose, cache_bflush, cache_bstat) (cache_iovec): New functions and global variable, implement a cache "iovec", where applicable set bfd_error. (bfd_cache_init, bfd_cache_close): Set/test the bfd's iovec. * bfdio.c (struct bfd_iovec): Define. (real_read): Delete function. (bfd_bread, bfd_bread, bfd_bwrite, bfd_tell, bfd_flush, bfd_stat) (bfd_seek, bfd_get_mtime, bfd_get_size): Use the bfd's "iovec", assume that bread and bwrite set bfd_error. * bfd.c (struct bfd): Add "iovec", update comments. * bfd-in2.h, libbfd.h: Re-generate.
* 2004-02-11 Andrew Cagney <cagney@redhat.com>Andrew Cagney2004-02-111-4/+6
| | | | | | | | | | | | | | | | | | | * bfd-in.h: Update copyright. (bfd_tell): Change return type to file_ptr. * bfd-in2.h: Re-generate. * cache.c: Update copyright. (bfd_cache_lookup_worker): Use real_fseek, do not cast offset parameter. (close_one): Use real_ftell. * bfdio.c: Update copyright. (real_ftell, real_fseek): New functions. (bfd_tell): Use real_fseek and real_ftell, change return type to file_ptr. (bfd_seek): Use real_ftell and real_fseek, change type of file_position to a file_ptr. * libbfd-in.h: Update copyright. (real_ftell, real_fseek): Declare. * libbfd.h: Re-generate.
* Convert to C90 and a few tweaks.Alan Modra2003-06-291-24/+14
|
* s/boolean/bfd_boolean/ s/true/TRUE/ s/false/FALSE/. SimplifyAlan Modra2002-11-301-18/+18
| | | | comparisons of bfd_boolean vars with TRUE/FALSE. Formatting.
* * aout-adobe.c: Don't compare against "true" or "false.Alan Modra2002-06-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * aout-target.h: Likewise. * aoutx.h: Likewise. * archive.c: Likewise. * bout.c: Likewise. * cache.c: Likewise. * coff-a29k.c: Likewise. * coff-alpha.c: Likewise. * coff-i386.c: Likewise. * coff-mips.c: Likewise. * coff-or32.c: Likewise. * coff64-rs6000.c: Likewise. * coffcode.h: Likewise. * coffgen.c: Likewise. * cpu-ns32k.c: Likewise. * ecoff.c: Likewise. * ecofflink.c: Likewise. * elf.c: Likewise. * elf32-arm.h: Likewise. * elf32-cris.c: Likewise. * elf32-d30v.c: Likewise. * elf32-i386.c: Likewise. * elf32-mcore.c: Likewise. * elf32-ppc.c: Likewise. * elf32-sh.c: Likewise. * elf32-sh64.c: Likewise. * elf32-v850.c: Likewise. * elf64-alpha.c: Likewise. * elf64-sh64.c: Likewise. * elfcode.h: Likewise. * elfcore.h: Likewise. * elflink.h: Likewise. * elfxx-mips.c: Likewise. * i386os9k.c: Likewise. * ieee.c: Likewise. * libbfd.c: Likewise. * linker.c: Likewise. * mmo.c: Likewise. * nlm32-alpha.c: Likewise. * nlm32-i386.c: Likewise. * nlm32-ppc.c: Likewise. * nlm32-sparc.c: Likewise. * nlmcode.h: Likewise. * oasys.c: Likewise. * pdp11.c: Likewise. * peicode.h: Likewise. * reloc.c: Likewise. * som.c: Likewise. * srec.c: Likewise. * tekhex.c: Likewise. * vms.c: Likewise. * xcofflink.c: Likewise. * elf64-sparc.c: Edit comment to not use "== false". * aoutf1.h: Don't use "? true : false". * ecoff.c: Likewise. * format.c: Likewise. * ieee.c: Likewise. * linker.c: Likewise. * mmo.c: Likewise. * oasys.c: Likewise.
* Touches most files in bfd/, so likely will be blamed for everything..Alan Modra2001-09-181-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | o bfd_read and bfd_write lose an unnecessary param and become bfd_bread and bfd_bwrite. o bfd_*alloc now all take a bfd_size_type arg, and will error if size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files or bugs in linker scripts etc. o file_ptr becomes a bfd_signed_vma. Besides matching sizes with various other types involved in handling sections, this should make it easier for bfd to support a 64 bit off_t on 32 bit hosts that provide it. o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*) generally available. They now cast their args to bfd_vma and bfd_byte * as appropriate, which removes a swag of casts from the source. o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and aout-encap.c. o Zillions of formatting and -Wconversion fixes.
* Update copyright noticesNick Clifton2001-03-081-1/+1
|
* Use SEGREL32 relocs for elf32-hppa unwind.Alan Modra2001-01-141-2/+2
|
* 2000-11-28 Kazu Hirata <kazu@hxi.com>Kazu Hirata2000-11-281-9/+8
| | | | | | | | | | | | * aoutx.h: Fix formatting. * bfd-in.h: Likewise. * bfd-in2.h: Likewise. * cache.c: Likewise. * cisco-core.c: Likewise. * coff64-rs6000.c: Likewise. * coffcode.h: Likewise. * coffswap.h: Likewise. * corefile.c: Likewise.
* Eli Zaretskii's DOSish file name patches.Alan Modra2000-05-261-1/+9
|
* 2000-04-03 H.J. Lu <hjl@gnu.org>Ian Lance Taylor2000-04-031-4/+19
| | | | | * cache.c (bfd_open_file): Unlink the output file only if it has none zero size.
* Initial revisionRichard Henderson1999-05-031-0/+350