summaryrefslogtreecommitdiff
path: root/bfd/opncls.c
Commit message (Collapse)AuthorAgeFilesLines
* * opncls.c (get_alt_debug_link_info_shim): Update type of 'len'.Tom Tromey2013-10-091-1/+1
|
* bfdTom Tromey2013-10-091-2/+3
| | | | | | | | | * bfd-in2.h: Rebuild. * opncls.c (bfd_get_alt_debug_link_info): Change type of buildid_len to bfd_size_type. gdb * dwarf2read.c (dwarf2_get_dwz_file): Update for type change in bfd_get_alt_debug_link_info.
* fix PR symtab/15597Tom Tromey2013-10-081-9/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes gdb PR symtab/15597. The bug is that the .gnu_debugaltlink section includes the build-id of the alt file, but gdb does not use it. This patch fixes the problem by changing gdb to do what it ought to always have done: verify the build id of the file found using the filename in .gnu_debugaltlink; and if that does not match, try to find the correct debug file using the build-id and debug-file-directory. This patch touches BFD. Previously, gdb had its own code for parsing .gnu_debugaltlink; I changed it to use the BFD functions after those were introduced. However, the BFD functions are incorrect -- they assume that .gnu_debugaltlink is formatted like .gnu_debuglink. However, it it is not. Instead, it consists of a file name followed by the build-id -- no alignment, and the build-id is not a CRC. Fixing this properly is a bit of a pain. But, because separate_alt_debug_file_exists just has a FIXME for the build-id case, I did not fix it properly. Instead I introduced a hack. This leaves BFD working just as well as it did before my patch. I'm willing to do something better here but I could use some guidance as to what. It seems that the build-id code in BFD is largely punted on. FWIW gdb is the only user of bfd_get_alt_debug_link_info outside of BFD itself. I moved the build-id logic out of elfread.c and into a new file. This seemed cleanest to me. Writing a test case was a bit of a pain. I added a couple new features to the DWARF assembler to handle this. Built and regtested on x86-64 Fedora 18. * bfd-in2.h: Rebuild. * opncls.c (bfd_get_alt_debug_link_info): Add buildid_len parameter. Change type of buildid_out. Update. (get_alt_debug_link_info_shim): New function. (bfd_follow_gnu_debuglink): Use it. * Makefile.in (SFILES): Add build-id.c. (HFILES_NO_SRCDIR): Add build-id.h. * build-id.c: New file, largely from elfread.c. Modified most functions. * build-id.h: New file. * dwarf2read.c (dwarf2_get_dwz_file): Update for change to bfd_get_alt_debug_link_info. Verify dwz file's build-id. Search for dwz file using build-id. * elfread.c (build_id_bfd_get, build_id_verify) (build_id_to_debug_filename, find_separate_debug_file): Remove. * gdb.dwarf2/dwzbuildid.exp: New file. * lib/dwarf.exp (Dwarf::_section): Add "flags" and "type" parameters. (Dwarf::_defer_output): Change "section" parameter to "section_spec"; update. (Dwarf::gnu_debugaltlink, Dwarf::_note, Dwarf::build_id): New procs.
* * dwarf2.c (struct dwarf2_debug): Add fields for handlingNick Clifton2013-05-291-40/+149
| | | | | | | | | | | | | | | | | | | | | | | | alternate debug info source. (dwarf_debug_sections): Add entries for alternate .debug_str and .debug_info sections. (dwarf_debug_section_enum): Likewise. (read_alt_indirect_string): New function. Handles a DW_FORM_GNU_strp_alt attribute. (read_alt_indirect_ref): New function. Handles a DW_FORM_GNU_ref_alt attribute. (read_attribute_value): Process DW_FORM_GNU_ref_alt and DW_FORM_GNU_strp_alt. (find_abstract_instance_name): Handle DW_FORM_GNU_ref_alt attributes. (_bfd_dwarf2_cleanup_debug_info): Free alternate debug info sources. * opncls.c (GNU_DEBUGALTLINK): Define. (bfd_get_alt_debug_link_info): New function. (separate_alt_debug_file_exists): New function. (find_separate_debug_file): Add parameters for fetch and check functions. (bfd_follow_gnu_debugaltlink): New function. * bfd-in2.h: Regenerate.
* * coffcode.h: Added a cast to void when a bfd_set_section_*()Nick Clifton2013-04-171-4/+3
| | | | | | | | | | | | | | macro's return value is ignored. * elf32-hppa.c: Likewise. * elf32-tic6x.c: Likewise. * mach-o.c: Likewise. * mmo.c: Likewise. * opncls.c: Likewise. * peicode.h: Likewise. * elf32-m32r.c: Check return value of bfd_set_section_*(). * elfnn-ia64.c: Likewise. * elfxx-mips.c: Likewise. * vms-alpha.c: Likewise.
* gdbTom Tromey2013-03-141-8/+10
| | | | | | | | | | | * symfile.c (get_debug_link_info): Remove. (find_separate_debug_file_by_debuglink): Use bfd_get_debug_link_info. bfd * opncls.c (bfd_get_debug_link_info): Rename from get_debug_link_info. Export. Update comment. (find_separate_debug_file): Update. * bfd-in2.h: Rebuild.
* * bfd.c (struct bfd_preserve, bfd_preserve_save, bfd_preserve_restore,Alan Modra2013-01-261-1/+1
| | | | | | | | | | | | | | | | | bfd_preserve_finish): Move to.. * format.c: ..here, splitting out.. (bfd_reinit): ..this. New function. (bfd_check_format_matches): Use bfd_preserve_save/restore to keep bfd state for a match. * elfcode.h (elf_object_p): Don't use bfd_preserve_save/restore. * elfcore.h (elf_core_file_p): Likewise. * mach-o.c (bfd_mach_o_header_p): Likewise. * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise. * xsym.c (bfd_sym_object_p): Likewise. * mmo.c (mmo_scan): Clear abfd->symcount. * opncls.c (_bfd_new_bfd): Use a smaller section hash table. * section.c (bfd_section_list_clear): Clear section_htab.count. * bfd-in2.h: Regenerate.
* PR binutils/14813Alan Modra2013-01-141-3/+3
| | | | | | | | | * 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.
* Remove trailing white spaces in bfdH.J. Lu2013-01-101-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * aout0.c: Remove trailing white spaces. * archive.c: Likewise. * archures.c: Likewise. * bfd-in.h: Likewise. * bfd-in2.h: Likewise. * coff-alpha.c: Likewise. * coff-i860.c: Likewise. * coff-mips.c: Likewise. * coff-ppc.c: Likewise. * coff-tic80.c: Likewise. * coff-x86_64.c: Likewise. * coff-z80.c: Likewise. * coffcode.h: Likewise. * coffgen.c: Likewise. * cofflink.c: Likewise. * compress.c: Likewise. * corefile.c: Likewise. * cpu-arm.c: Likewise. * cpu-avr.c: Likewise. * cpu-bfin.c: Likewise. * cpu-cr16.c: Likewise. * cpu-cr16c.c: Likewise. * cpu-crx.c: Likewise. * cpu-h8300.c: Likewise. * cpu-i386.c: Likewise. * cpu-lm32.c: Likewise. * cpu-m68k.c: Likewise. * cpu-moxie.c: Likewise. * cpu-msp430.c: Likewise. * cpu-sh.c: Likewise. * cpu-xc16x.c: Likewise. * dwarf2.c: Likewise. * ecofflink.c: Likewise. * ecoffswap.h: Likewise. * elf-ifunc.c: Likewise. * elf-m10300.c: Likewise. * elf-vxworks.c: Likewise. * elf32-avr.c: Likewise. * elf32-avr.h: Likewise. * elf32-cr16.c: Likewise. * elf32-cr16c.c: Likewise. * elf32-cris.c: Likewise. * elf32-crx.c: Likewise. * elf32-frv.c: Likewise. * elf32-hppa.c: Likewise. * elf32-i860.c: Likewise. * elf32-ip2k.c: Likewise. * elf32-iq2000.c: Likewise. * elf32-m32c.c: Likewise. * elf32-m68hc1x.c: Likewise. * elf32-msp430.c: Likewise. * elf32-mt.c: Likewise. * elf32-ppc.c: Likewise. * elf32-rl78.c: Likewise. * elf32-s390.c: Likewise. * elf32-score.h: Likewise. * elf32-sh-symbian.c: Likewise. * elf32-sh.c: Likewise. * elf32-spu.c: Likewise. * elf32-tic6x.c: Likewise. * elf32-v850.c: Likewise. * elf32-xc16x.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-hppa.c: Likewise. * elf64-ppc.c: Likewise. * elf64-s390.c: Likewise. * elfcore.h: Likewise. * elflink.c: Likewise. * elfxx-mips.c: Likewise. * elfxx-sparc.c: Likewise. * elfxx-tilegx.c: Likewise. * ieee.c: Likewise. * libcoff.h: Likewise. * libpei.h: Likewise. * libxcoff.h: Likewise. * linker.c: Likewise. * mach-o-i386.c: Likewise. * mach-o-target.c: Likewise. * mach-o.c: Likewise. * mach-o.h: Likewise. * mmo.c: Likewise. * opncls.c: Likewise. * pdp11.c: Likewise. * pe-x86_64.c: Likewise. * peXXigen.c: Likewise. * pef-traceback.h: Likewise. * pei-x86_64.c: Likewise. * peicode.h: Likewise. * plugin.c: Likewise. * reloc.c: Likewise. * riscix.c: Likewise. * section.c: Likewise. * som.c: Likewise. * syms.c: Likewise. * tekhex.c: Likewise. * ticoff.h: Likewise. * vaxbsd.c: Likewise. * xcofflink.c: Likewise. * xtensa-isa.c: Likewise.
* Remove trailing redundant `;'H.J. Lu2012-11-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bfd/ * aout-tic30.c (MY_final_link_callback): Remove trailing redundant `;'. * coff-h8500.c (extra_case): Likewise. (bfd_coff_reloc16_get_value): Likewise. * dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Likewise. * elf.c (_bfd_elf_slurp_version_tables): Likewise. * elf32-frv.c (elf32_frv_relocate_section): Likewise. * elf32-v850.c (v850_elf_perform_relocation): Likewise. * opncls.c (bfd_calc_gnu_debuglink_crc32): Likewise. * plugin.c (add_symbols): Likewise. * reloc.c (bfd_check_overflow): Likewise. * vms-lib.c (_bfd_vms_lib_archive_p): Likewise. binutils/ * coffgrok.c (coff_grok): Remove trailing redundant `;'. * resrc.c (open_input_stream): Likewise. gas/ * config/atof-ieee.c (gen_to_words): Remove trailing redundant `;'. * config/atof-vax.c (flonum_gen2vax): Likewise. * config/tc-d10v.c (write_2_short): Likewise. * config/tc-i386-intel.c (i386_intel_simplify): Likewise. * config/tc-s390.c (tc_s390_force_relocation): Likewise. * config/tc-v850.c (md_parse_option): Likewise. * config/tc-xtensa.c (find_address_of_next_align_frag): Likewise. * dwarf2dbg.c (out_header): Likewise. * symbols.c (dollar_label_name): Likewise. (fb_label_name): Likewise. ld/ * testplug.c (record_add_file): Remove trailing redundant `;'. opcodes/ * aarch64-opc.h (gen_mask): Remove trailing redundant `;'. * ia64-gen.c (fetch_insn_class): Likewise.
* Change return type of bclose to bfd_booleanH.J. Lu2012-11-071-2/+2
| | | | | | | | | | | 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.
* PR binutils/14567Alan Modra2012-11-061-0/+4
| | | | | | * opncls.c (opncls_iovec): Forward declare. (_bfd_new_bfd_contained_in): If using opncls_iovec, copy iostream to new bfd.
* * vms-lib.c (_bfd_vms_lib_get_module): Use bfd_zmalloc forTom Tromey2012-08-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | areltdata. * opncls.c (_bfd_delete_bfd): Free arelt_data. * mach-o.c (bfd_mach_o_fat_member_init): Use bfd_zmalloc for areltdata. * ecoff.c (_bfd_ecoff_slurp_armap): Use free for mapdata. * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Use bfd_zmalloc for areltdata. (xcoff_write_archive_contents_old): Likewise. (xcoff_write_archive_contents_big): Likewise. * archive64.c (bfd_elf64_archive_slurp_armap): Use free for areltdata. * archive.c (_bfd_generic_read_ar_hdr_mag): Use bfd_zmalloc and free for areltdata. (_bfd_get_elt_at_filepos): Likewise. Clear n_nfd->arelt_data on failure. (do_slurp_bsd_armap): Use bfd_zmalloc and free for areltdata. (do_slurp_coff_armap): Likewise. (_bfd_slurp_extended_name_table): Likewise. (bfd_slurp_bsd_armap_f2): Likewise. Don't leak 'mapdata'.
* * archive.c (SECTION Archives): Update documentation.Alan Modra2012-08-091-12/+0
| | | | | | | | | | | | | | (_bfd_delete_archive_data): Remove. (_bfd_add_bfd_to_archive_cache): Set 'parent_cache' and 'key'. (archive_close_worker, _bfd_archive_close_and_cleanup): New functions. * libbfd-in.h (struct areltdata <parent_cache, key>): New fields. (_bfd_delete_archive_data): Don't declare. (_bfd_archive_close_and_cleanup): Declare. (_bfd_generic_close_and_cleanup): Redefine. * libbfd.h: Rebuild. * opncls.c (_bfd_delete_bfd): Don't call _bfd_delete_archive_data. (bfd_close): Don't close nested thin archives here.
* * config/tc-i386.c (lex_got): Provide implementation for PENick Clifton2012-08-071-0/+4
| | | | | | | | | | | | | | | format. * gas/i386/secrel.s: Add test of <symbol>@SECREL32. * gas/i386/secrel.d: Add expected disassembly. * scripttempl/pe.sc (R_TLS): Add .tls$AAA and .tls$ZZZ. * scripttempl/pep.sc (R_TLS): Add .tls$AAA and .tls$ZZZ. * archive.c (_bfd_delete_archive_data): New function. * libbfd-in.h (_bfd_delete_archive_data): Declare. * libbfd.h: Rebuild. * opncls.c (_bfd_delete_bfd): Call _bfd_delete_archive_data.
* * opncls.c (_bfd_delete_bfd): Now static.Tom Tromey2012-08-031-1/+1
| | | | | * libbfd-in.h (_bfd_delete_bfd): Don't declare. * libbfd.h: Rebuild.
* bfd/Tom Tromey2012-05-291-2/+16
| | | | | | | | | | | | | * opncls.c (bfd_fopen): Always close fd on failure. (bfd_fdopenr): Likewise. gdb/ * symfile.c (symfile_bfd_open): Don't close desc if bfd_fopen fails. * solib.c (solib_bfd_fopen): Don't close fd if bfd_fopen fails. * exec.c (exec_file_attach): Don't close scratch_chan if bfd_fopen fails. * dwarf2read.c (try_open_dwo_file): Don't close fd if bfd_fopen fails.
* 2011-06-27 Tristan Gingold <gingold@adacore.com>Tristan Gingold2011-06-271-1/+3
| | | | | | | | | | | | * 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.
* PR ld/12365Alan Modra2011-04-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR ld/12672 bfd/ * bfd.c (BFD_PLUGIN): Define. (BFD_FLAGS_SAVED, BFD_FLAGS_FOR_BFD_USE_MASK): Add BFD_PLUGIN. * bfd-in2.h: Regenerate. * elflink.c (elf_link_output_extsym): Strip undefined plugin syms. * opncls.c (bfd_make_readable): Don't lose original bfd flags. ld/ * ldfile.c (ldfile_try_open_bfd): Don't attempt any plugin action when no_more_claiming. * ldmain.c (add_archive_element): Likewise. (multiple_definition): Remove plugin_multiple_definition call. (notice): Remove plugin_notice call. * ldlang.c (lang_list_insert_after, void lang_list_remove_tail): Move. Delete prototype. (plugin_insert): New static var. (open_input_bfds): Only rescan libs after plugin insert point. (lang_gc_sections): Omit plugin claimed files. (lang_process): Set plugin_insert. Only rescan when plugin adds objects. * plugin.h (no_more_claiming): Declare. (plugin_notice, plugin_multiple_definition): Don't declare. * plugin.c: Formatting. (orig_notice_all, orig_allow_multiple_defs, orig_callbacks, plugin_callbacks): New static vars. (no_more_claiming): Make global. (plugin_cached_allow_multiple_defs): Delete. (plugin_get_ir_dummy_bfd): Set SEC_EXCLUDE on dummy .text section, use newer bfd_make_section variant. Make COMMON section too. Error handling. Correct setting of gp size. (asymbol_from_plugin_symbol): Properly cast last arg of concat. (message): Likewise for ACONCAT. (asymbol_from_plugin_symbol): Use our COMMON section. (get_symbols): When report_plugin_symbols, show visibility too. (init_non_ironly_hash): Move. Don't test non_ironly_hash. (plugin_load_plugins): Save state of linker callbacks, set up to call plugin_notice instead. Call init_non_ironly_hash here. (plugin_call_all_symbols_read): Set plugin_multiple_definition in plugin callbacks. (plugin_notice): Rewrite. (plugin_multiple_definition): Make static, call original callback. ld/testsuite/ * ld-plugin/plugin-7.d: Adjust for plugin changes. * ld-plugin/plugin-8.d: Likewise. * ld-plugin/plugin.exp: Pass --verbose=2 for visibility test, and compare ld output to.. * ld-plugin/plugin-12.d: New.
* * opncls.c (bfd_alloc, bfd_zalloc): Don't mark internal.Alan Modra2010-10-251-2/+2
| | | | | | * libbfd-in.h (bfd_alloc, bfd_zalloc): Don't declare here. * libbfd.h: Regenerate * bfd-in2.h: Regenerate.
* * opncls.c (_bfd_id_counter): Rename to bfd_id_counter.Alan Modra2010-10-251-5/+19
| | | | | | | (bfd_reserved_id_counter, bfd_use_reserved_id): New vars. (_bfd_new_bfd): Use negative id when bfd_use_reserved_id. (bfd_create): Doc fix. * bfd-in2.h: Regenerate.
* 2010-05-25 Tristan Gingold <gingold@adacore.com>Tristan Gingold2010-05-261-15/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bfdio.c: Declare and define _bfd_memory_iovec. (bfd_bread): Move code for BFD_IN_MEMORY... (bfd_bwrite): ... Ditto ... (bfd_tell): ... Ditto ... (bfd_flush): ... Ditto ... (bfd_stat): ... Ditto ... (bfd_seek): ... Ditto ... (bfd_get_size): ... Ditto ... (bfd_mmap): ... Ditto ... (memory_bread): ... to these new functions. (memory_bwrite): Ditto. (memory_btell): Ditto. (memory_bseek): Ditto. (memory_bflush): Ditto. (memory_bstat): Ditto. (memory_bmmap): Ditto. (memory_bclose): New function. * peicode.h (pe_ILF_build_a_bfd): Use BFD_IN_MEMORY. * xcofflink.c (bfd_xcoff_link_generate_rtinit): Ditto. * opncls.c (bfd_close): Do not handle BFD_IN_MEMORY case. (bfd_make_writable): Use _bfd_memory_iovec. * elfcode.h (bfd_from_remote_memory): Use _bfd_memory_iovec. * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Use _bfd_memory_iovec. (alpha_ecoff_openr_next_archived_file): Use proxy_origin instead of origin. * libbfd.h: Regenerate.
* 2009-12-15 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu2009-12-151-10/+10
| | | | | | | * opncls.c (bfd_opnr_iovec): Replace _XXX with XXX_P in parameters. * tekhex.c (pass_over): Replace eof with is_eof.
* 2009-12-14 Doug Kwan <dougkwan@google.com>Doug Kwan2009-12-151-22/+22
| | | | | | | | | | | | | | | | bfd/ChangeLog: * opncls.c (bfd_opnr_iovec): Rename parameters to avoid shawdowed variable warnings. * bfd-in2.h: Regnenerate. include/ChangeLog: * bfdlink.h (struct bfd_link_callbacks): Rename function parameters to avoid shadowed variable warnings. * dis-asm.h (struct disassemble_info): Ditto. (disassemble_init_for_target): Ditto. (init_disassemble_info): Ditto.
* Add -Wshadow to the gcc command line options used when compiling the binutils.Nick Clifton2009-12-111-31/+24
| | | | Fix up all warnings generated by the addition of this switch.
* PR binutils/10802Alan Modra2009-10-201-1/+1
| | | | * opncls.c (_maybe_make_executable): Make DYNAMIC files executable.
* PR binutils/10785Alan Modra2009-10-161-1/+3
| | | | | | | | * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Don't bfd_alloc bim and bim->buffer. bfd_malloc instead. * peicode.h (pe_ILF_build_a_bfd): Similarly. (ILF_DATA_SIZE): Don't include bim. * opncls.c (bfd_close): Test bim->buffer non-NULL before freeing.
* Updated soruces in bfd/* to compile cleanly with -Wc++-compat.Nick Clifton2009-09-091-19/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
|
* * opncls.c (bfd_close): Until BFD_IN_MEMORY has an iovec,Doug Evans2009-08-161-5/+11
| | | | at least don't leak memory.
* * opncls.c (_maybe_make_executable): New function. Gives executeNick Clifton2009-06-121-36/+30
| | | | | | | permission to an executable bfd that was opened for writing provided that it is a regular file. Replaces common code found in... (bfd_close): here and ... (bfd_close_all_done): here.
* 2009-06-10 Paul Pluzhnikov <ppluzhnikov@google.com>Paul Pluzhnikov2009-06-111-1/+12
| | | | | | | | | | * 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.
* (find_separate_debug_file): Use the canonicalAndreas Schwab2008-08-231-8/+22
| | | | | absolute name of the bfd object for finding the debug file in the global debugfile directory.
* Add support for thin archives.Nick Clifton2008-03-281-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bfd/archive.c (_bfd_find_nested_archive): New function. (get_extended_arelt_filename): Add origin parameter. (_bfd_generic_read_ar_hdr_mag): Deal with extended name combined with a file offset. (append_relative_path): New function. (_bfd_get_elt_at_filepos): Deal with external members and nested archives. (bfd_generic_openr_next_archived_file): Thin archives. (bfd_generic_archive_p): Recognize new magic string. (adjust_relative_path): New function. (_bfd_construct_extended_name_table): Construct extended names for thin archive members. (_bfd_write_archive_contents): Emit new magic string, skip copying files for thin archives. * bfd/bfd-in.h (bfd_is_thin_archive): New macro. * bfd/bfd.c (struct bfd): New fields for thin archives. * bfd/libbfd-in.h (struct areltdata): New field for thin archives. * bfd/opncls.c (bfd_close): Delete BFDs for nested archives. * binutils/ar.c (make_thin_archive): New global flag. (map_over_members): Deal with full pathnames in thin archives. (usage, main): Add 'T' option for building thin archives. (replace_members): Pass thin archive flag to ar_emul_append. * binutils/arsup.c (ar_open): Initialize new flag. * binutils/binemul.c (ar_emul_append): Add new parameter for flattening nested archives. (do_ar_emul_default_append): New function. (ar_emul_default_append): Factored out recursive code. * binutils/binemul.h (ar_emul_default_append): Add new parameter. (struct bin_emulation_xfer_struct): New parameter for ar_append. * binutils/dlltool.c (gen_lib_file): Initialize thin archive flag. * binutils/emul_aix.c (ar_emul_aix_internal): Add new flatten parameter, currently unimplemented. All callers changed. * binutils/objcopy.c (copy_archive): Preserve thin archive flag. * binutils/doc/binutils.texi: Update ar documentation. * binutils/testsuite/binutils-all/ar.exp: Add thin archive tests. * include/aout/ar.h (ARMAGT): New magic string for thin archives.
* PR 5328Alan Modra2007-11-151-5/+5
| | | | | * opncls.c (separate_debug_file_exists): Use fopen/fread rather than open/read and open in binary mode.
* * opncls.c (find_separate_debug_file): Ensure bfd_set_error hasAlan Modra2007-09-141-23/+27
| | | | | | been called on all error return paths. (bfd_fill_in_gnu_debuglink_section): Use bfd_malloc, not malloc. Clear padding after filename
* * opncls.c (bfd_openr_iovec): Fix the OPEN parameter macro expansion.Jan Kratochvil2007-08-091-1/+2
|
* 2007-07-23 Michael Snyder <msnyder@access-company.com>Michael Snyder2007-07-241-0/+2
| | | | * opncls.c (bfd_make_writable): Check return from bfd_malloc.
* Switch sources over to use the GPL version 3Nick Clifton2007-07-031-2/+3
|
* 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.
* bfd/Alan Modra2006-12-151-4/+21
| | | | | | | | | | | * opncls.c (bfd_openr_iovec): Add "stat" parameter. (struct opncls): Add "stat" field. (opncls_bstat): Call vec->stat. * bfd-in2.h: Regenerate. * elf32-spu.c (spu_elf_open_builtin_lib): Adjust. gdb/ * spu-linux-nat.c (spu_bfd_iovec_stat): New function. (spu_bfd_open): Adjust bfd_openr_iovec call.
* * stabs.c (_bfd_link_section_stabs): Use bfd_make_section*_with_flagsAlan Modra2006-06-011-7/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instead of bfd_make_section*. * aix386-core.c: Likewise. * aix5ppc-core.c: Likewise. * aout-adobe.c: Likewise. * aoutf1.h: Likewise. * binary.c: Likewise. * cisco-core.c: Likewise. * coff-arm.c: Likewise. * coff-h8300.c: Likewise. * elf.c: Likewise. * elf32-bfin.c: Likewise. * elf32-m32c.c: Likewise. * hppabsd-core.c: Likewise. * hpux-core.c: Likewise. * i386linux.c: Likewise. * ieee.c: Likewise. * ihex.c: Likewise. * irix-core.c: Likewise. * lynx-core.c: Likewise. * m68klinux.c: Likewise. * mach-o.c: Likewise. * netbsd-core.c: Likewise. * nlmcode.h: Likewise. * opncls.c: Likewise. * osf-core.c: Likewise. * peXXigen.c: Likewise. * ppcboot.c: Likewise. * ptrace-core.c: Likewise. * rs6000-core.c: Likewise. * sco5-core.c: Likewise. * sparclinux.c: Likewise. * srec.c: Likewise. * sunos.c: Likewise. * trad-core.c: Likewise. * xcofflink.c: Likewise. * xsym.c: Likewise.
* 2006-04-25 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu2006-04-251-2/+26
| | | | | | | | | | | | | | | | | | | | PR binutils/2467 * elf.c (_bfd_elf_close_and_cleanup): Check elf_tdata (abfd) is NULL first. * elf32-arm.c (elf32_arm_close_and_cleanup): Check if abfd->sections is NULL. (elf32_arm_bfd_free_cached_info): New. (bfd_elf32_bfd_free_cached_info): Defined. * elfxx-target.h (bfd_elfNN_bfd_free_cached_info): Default it to _bfd_free_cached_info. * libbfd-in.h (_bfd_free_cached_info): New. * libbfd: Regenerated. * opncls.c (_bfd_delete_bfd): Check if abfd->memory is NULL. (_bfd_free_cached_info): New.
* PR 2434Alan Modra2006-03-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bfd/ * elflink.c (struct elf_smash_syms_data, elf_smash_syms): Delete. (elf_link_add_object_symbols): Delete unnecessary locals. Rename hash_table -> htab. Formatting. Save entire symbol table before loading as-needed syms, and restore afterwards if lib not needed. Use bfd_hash_allocate rather than bfd_alloc for sym name. Free some buffers earlier. * bfd-in.h (struct bfd_hash_table): Add entsize. (bfd_hash_table_init, bfd_hash_table_init_n): Adjust prototype. * elf-bfd.h (_bfd_elf_link_hash_table_init): Likewise * hash.c (bfd_hash_table_init_n): Add entsize param, save to hash table. (bfd_hash_table_init): Add param, adjust calls. * aoutx.h: Adjust all hash_table_init functions and calls. * bfd.c: Likewise. * coff-arm.c: Likewise. * coff-h8300.c: Likewise. * coff-ppc.c: Likewise. * cofflink.c: Likewise. * ecoff.c: Likewise. * ecofflink.c: Likewise. * elf-m10300.c: Likewise. * elf-strtab.c: Likewise. * elf.c: Likewise. * elf32-arm.c: Likewise. * elf32-bfin.c: Likewise. * elf32-cris.c: Likewise. * elf32-frv.c: Likewise. * elf32-hppa.c: Likewise. * elf32-i386.c: Likewise. * elf32-m32r.c: Likewise. * elf32-m68hc1x.c: Likewise. * elf32-m68k.c: Likewise. * elf32-ppc.c: Likewise. * elf32-s390.c: Likewise. * elf32-sh.c: Likewise. * elf32-vax.c: Likewise. * elf64-alpha.c: Likewise. * elf64-hppa.c: Likewise. * elf64-ppc.c: Likewise. * elf64-s390.c: Likewise. * elf64-sh64.c: Likewise. * elf64-x86-64.c: Likewise. * elfxx-ia64.c: Likewise. * elfxx-mips.c: Likewise. * elfxx-sparc.c: Likewise. * i386linux.c: Likewise. * libaout.h: Likewise. * libbfd-in.h: Likewise. * libcoff-in.h: Likewise. * linker.c: Likewise. * m68klinux.c: Likewise. * merge.c: Likewise. * opncls.c: Likewise. * pdp11.c: Likewise. * sparclinux.c: Likewise. * stabs.c: Likewise. * sunos.c: Likewise. * vms.c: Likewise. * xcofflink.c: Likewise. * section.c (struct section_hash_entry): Move to.. * libbfd-in.h: ..here. * Makefile.am: Run "make dep-am" * Makefile.in: Regenerate. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * libcoff.h: Regenerate. binutils/ * ieee.c (write_ieee_debugging_info): Adjust bfd_hash_table_init calls. * wrstabs.c (write_stabs_in_sections_debugging_info): Likewise. ld/ * ldcref.c (add_cref): Adjust bfd_hash_table_init calls. * ldlang.c (output_statement_table_init, lang_init): Likewise. * ldmain.c (add_ysym, add_wrap, add_keepsyms_file): Likewise. (undefined_symbol): Likewise.
* * configure.in: Check for fopen64.Daniel Jacobowitz2005-11-031-2/+2
| | | | | | | | * 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.
* * 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.
* * libbfd-in.h (bfd_malloc2, bfd_realloc2, bfd_zmalloc2, bfd_alloc2,Jakub Jelinek2005-07-051-0/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | bfd_zalloc2): New prototypes. * bfd-in.h (HALF_BFD_SIZE_TYPE): Define. * libbfd.c (bfd_malloc2, bfd_realloc2, bfd_zmalloc2): New functions. * opncls.c (bfd_alloc2, bfd_zalloc2): New functions. * elf.c (bfd_elf_get_elf_syms, setup_group, assign_section_numbers, elf_map_symbols, map_sections_to_segments, assign_file_positions_for_segments, copy_private_bfd_data, swap_out_syms, _bfd_elf_slurp_version_tables): Use bfd_*alloc2 where appropriate. * bfd-in2.h: Rebuilt. * libbfd.h: Rebuilt. * elf.c (_bfd_elf_print_private_bfd_data): Don't crash on bogus verdef or verneed section. (_bfd_elf_slurp_version_tables): Handle corrupt verdef and/or verneed sections gracefully. * elfxx-sparc.c (_bfd_sparc_elf_info_to_howto_ptr): Don't crash on bogus relocation values. * elf64-ppc.c (ppc64_elf_info_to_howto): Likewise. * elf64-s390.c (elf_s390_info_to_howto): Likewise. * elf32-s390.c (elf_s390_info_to_howto): Likewise. * elf64-x86-64.c (elf64_x86_64_info_to_howto): Likewise. * elfxx-ia64.c (lookup_howto): Likewise.
* * opncls.c (bfd_fopen): Mark returned BFD as cacheable if FD == -1.Mark Mitchell2005-06-091-0/+8
|
* * opncls.c (bfd_fdopenr): Don't set bfd_error unconditionally.Alan Modra2005-06-081-2/+4
|
* * opncls.c (bfd_fopen): Don't set bfd_error unconditionally.Alan Modra2005-06-081-2/+1
|