summaryrefslogtreecommitdiff
path: root/bfd/format.c
Commit message (Collapse)AuthorAgeFilesLines
* * format.c (bfd_check_format_matches): Don't match a target inAlan Modra2013-05-231-1/+21
| | | | | | targ_selvecs if some other target is a better match. If targets implement match priority, fall back to the first of the best matches.
* * archive.c (bfd_generic_archive_p): Return target and keepAlan Modra2013-01-281-38/+37
| | | | | | | ardata on partial matches. * format.c (bfd_check_format_matches): Adjust for above change. Remove bfd_error_file_ambiguously_recognized dead code.
* * bfd.c (struct bfd_preserve, bfd_preserve_save, bfd_preserve_restore,Alan Modra2013-01-261-17/+130
| | | | | | | | | | | | | | | | | 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.
* * targets.c (bfd_target): Make ar_max_namelen an unsigned char.Alan Modra2011-06-061-9/+31
| | | | | | | | | | | | | | | | | | | | | | | Add match_priority. * configure.in: Bump bfd version. * elfcode.h (elf_object_p): Delete hacks preventing match of EM_NONE and ELFOSABI_NONE targets when a better match exists. * elfxx-target.h (elf_match_priority): Define and use. * format.c (bfd_check_format_matches): Use target match_priority to choose best of multiple matching targets. In cases with multiple matches rerun _bfd_check_format if we don't choose the last match. * aout-adobe.c, * aout-arm.c, * aout-target.h, * aout-tic30.c, * binary.c, * bout.c, * coff-alpha.c, * coff-i386.c, * coff-i860.c, * coff-i960.c, * coff-ia64.c, * coff-mips.c, * coff-or32.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-tic30.c, * coff-tic54x.c, * coff-x86_64.c, * coff64-rs6000.c, * coffcode.h, * i386msdos.c, * i386os9k.c, * ieee.c, * ihex.c, * mach-o-target.c, * mipsbsd.c, * mmo.c, * nlm-target.h, * oasys.c, * pdp11.c, * pe-mips.c, * pef.c, * plugin.c, * ppcboot.c, * som.c, * srec.c, * tekhex.c, * trad-core.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c, * xsym.c: Init match_priority field. * configure: Regenerate. * bfd-in2.h: Regenerate.
* Updated soruces in bfd/* to compile cleanly with -Wc++-compat.Nick Clifton2009-09-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
|
* PR 4453Alan Modra2008-01-211-6/+7
| | | | | * format.c (bfd_check_format_matches): Don't accept archives as fully matching unless they have a map.
* * format.c (bfd_check_format_matches): Record matching targets evenAlan Modra2007-09-141-77/+35
| | | | | | when "matching" is NULL to allow bfd_associated_vector matches. Consolidate error return code. Consolidate ok return code. Always restore original target and format on error.
* Switch sources over to use the GPL version 3Nick Clifton2007-07-031-2/+4
|
* 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.
* 2005-12-13 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu2005-12-131-1/+3
| | | | | | | | | PR ld/2008 * elf.c (_bfd_elf_setup_sections): Return FALSE if elf_linked_to_section will be set to NULL. * format.c (bfd_check_format_matches): Don't check the default target twice.
* * 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.
* * elf.c (_bfd_elf_write_object_contents): Check for non-NULLDaniel Jacobowitz2005-05-171-0/+16
| | | | | | | | elf_shstrtab. * format.c (bfd_check_format_matches): Set output_has_begun for both_direction. * section.c (bfd_set_section_contents): Use bfd_write_p. Remove special case for both_direction.
* 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
|
* update copyright datesAlan Modra2005-03-031-2/+2
|
* * coffcode.h (coff_sym_filepos): Remove GNU960 conditional code.Ben Elliston2005-02-241-10/+0
| | | | | | | * format.c (bfd_check_format_matches): Likewise. * archive.c (BFD_GNU960_ARMAG): Likewise. (bfd_generic_archive_p): Likewise. (_bfd_write_archive_contents): Likewise.
* * ChangeLog: Fix typos.Kazu Hirata2003-11-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ecoff.c: Fix comment typos. * ecofflink.c: Likewise. * format.c: Likewise. * hp300hpux.c: Likewise. * i386linux.c: Likewise. * ieee.c: Likewise. * m68klinux.c: Likewise. * mach-o.h: Likewise. * mipsbsd.c: Likewise. * oasys.c: Likewise. * opncls.c: Likewise. * peXXigen.c: Likewise. * reloc.c: Likewise. * reloc16.c: Likewise. * section.c: Likewise. * simple.c: Likewise. * som.c: Likewise. * som.h: Likewise. * sparclinux.c: Likewise. * srec.c: Likewise. * syms.c: Likewise. * targets.c: Likewise. * tekhex.c: Likewise. * versados.c: Likewise. * vms-gsd.c: Likewise. * vms-hdr.c: Likewise. * vms-misc.c: Likewise. * xcofflink.c: Likewise. * xsym.h: Likewise. * bfd-in2.h: Regenerate.
* Convert to C90 and a few tweaks.Alan Modra2003-06-291-24/+16
|
* Only check associated vector if the matching_vector has been created.Nick Clifton2003-04-181-1/+3
|
* Fix memory leaksNick Clifton2003-03-311-2/+10
|
* Change embedded documentation to use consistent indentation and to split upNick Clifton2003-02-141-24/+26
| | | | | long lines. Change informal style of description for functions lacking real documentation.
* s/boolean/bfd_boolean/ s/true/TRUE/ s/false/FALSE/. SimplifyAlan Modra2002-11-301-22/+22
| | | | comparisons of bfd_boolean vars with TRUE/FALSE. Formatting.
* * config.bfd (sh-*-linux*): Use bfd_elf*_sh64*lin_vec as sh64Alan Modra2002-11-051-13/+41
| | | | | | | | | | | | | | | | | | vectors in target_selvecs. (shle-*-netbsdelf*): Use bfd_elf*_sh64*nbsd_vec as sh64 vectors in target_selvecs. (sh-*-netbsdelf*): Likewise. * configure.in (assocvecs): New variable. Handle assocvecs like selvecs. * configure: Regenerate. * format.c (bfd_check_format_matches): Store bfd_target pointers in matching_vector instead of target names. Select first target from bfd_associated_vector that matches a list of ambiguous targets. * targets.c (_bfd_associated_vector): New array. (bfd_associated_vector): New variable. (_bfd_target_vector): Add bfd_elf*_sh64*lin_vec. * libbfd-in.h (bfd_associated_vector): Declare. * libbfd.h: Regenerate.
* * aoutx.h (NAME(aout,swap_ext_reloc_in)): Cast bytes->r_index toDave Anglin2002-10-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | unsigned int. Cast RELOC_BASE10, RELOC_BASE13 and RELOC_BASE22 to unsigned int. (NAME(aout,final_link)): Cast enum used in assignment. (aout_link_write_symbols): Cast enums in comparisons, int values to boolean, enums in assignments to int. (aout_link_input_section_std): Cast rel->r_index to unsigned int. (aout_link_input_section_ext): Likewise. Cast enums used in comparisons with unsigned ints. (aout_link_reloc_link_order): Cast enum to int in assignment. * archive.c (_bfd_generic_read_ar_hdr_mag): Cast result of memchr calls to char *. * bfd-in.h (bfd_set_section_vma): Cast enum true to unsigned int in assignment. * bfd-in2.h (bfd_set_section_vma): Likewise. * bfd.c (bfd_record_phdr): Cast enums in assignments. * binary.c (bfd_alloc): Cast enum to long. * coffgen.c (_bfd_coff_is_local_label_name): Cast return to boolean. * dwarf2.c (read_abbrevs): Add casts to enum types. (read_attribute_value): Likewise. (arange_add): Cast result of bfd_zalloc call. (comp_unit_contains_address): Return true and false. (comp_unit_find_nearest_line): Cast return to boolean. * format.c (bfd_check_format_matches, bfd_set_format): Likewise. * gen-aout.c: define macro '_' if not defined. * libbfd.c (bfd_realloc): Cast malloc and realloc to PTR. (bfd_bwrite): Cast bfd_realloc to bfd_byte *. (bfd_write_bigendian_4byte_int): Cast return to boolean. (bfd_seek): Cast bfd_realloc to bfd_byte *. (bfd_generic_is_local_label_name): Cast return to boolean. * libcoff.h (_bfd_coff_adjust_symndx): Remove extraneous '\'. * linker.c (_bfd_link_hash_newfunc): Cast bfd_hash_allocate result to struct bfd_hash_entry *. (_bfd_generic_link_hash_newfunc): likewise. (_bfd_generic_final_link): Cast enum to unsigned int. * merge.c (sec_merge_emit): Cast return to boolean. (merge_strings): Add casts to const unsigned char *. * reloc.c (bfd_get_reloc_code_name): Cast enums in comparison to int. (bfd_generic_get_relocated_section_content): Cast enum to unsigned int. * section.c (bfd_section_hash_newfunc): Cast bfd_hash_allocate result to struct bfd_hash_entry *. (bfd_set_section_content): Add cast to PTR in comparison. * simple.c (simple_dummy_warning, simple_dummy_undefined_symbol, simple_dummy_reloc_overflow, simple_dummy_reloc_dangerous, simple_dummy_unattached_reloc, bfd_simple_get_relocated_section_contents): Add K&R declarations and function definitions. * srec.c (S3Forced): Initialize to false. (srec_get_symtab): Cast return value from bfd_alloc to asymbol *. * stabs.c (_bfd_link_section_stabs): Cast enum to int in comparisons. (_bfd_discard_section_stabs): Likewise. Also cast return to boolean. * syms.c (bfd_is_undefined_symclass): Cast return to boolean. (_bfd_stab_section_find_nearest_line): Cast enum to bfd_byte in comparisons.
* * 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-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* * coffcode.h (coff_write_object_contents): Add ATTRIBUTE_UNUSED toAlan Modra2001-08-171-4/+2
| | | | | | | | | | | | | | | | | | | | | | | silence warning. * coffgen.c (coff_print_symbol): Fix warnings. (coff_find_nearest_line): Likewise. * cofflink.c (_bfd_coff_link_input_bfd): Likewise. * coff-alpha.c (alpha_convert_external_reloc): Likewise. * format.c (bfd_check_format_matches): Likewise. (bfd_set_format): Likewise. * coff-ia64.c: Add missing prototypes. * elf64-alpha.c (struct alpha_elf_link_hash_entry): Make addend signed to silence warnings. (elf64_alpha_relocate_section): Likewise. (elf64_alpha_find_reloc_at_ofs): Fix warnings. (elf64_alpha_add_symbol_hook): Likewise. (elf64_alpha_final_link): Likewise. (elf64_alpha_relax_section): Remove redundant assign to info.gotent. (elf64_alpha_merge_gots): Add ATTRIBUTE_UNUSED to unused args. (elf64_alpha_size_got_sections): Likewise. * elfxx-ia64.c: Add missing prototypes. (elfNN_ia64_relocate_section): Fix warning. (elfNN_ia64_unwind_entry_compare): Make params const.
* * bfd.c (enum bfd_error): Add bfd_error_wrong_object_format.Alan Modra2001-08-171-31/+66
| | | | | | | | | | | | | | (bfd_errmsgs): Add corresponding message. * archive.c (bfd_generic_archive_p): Don't release bfd_ardata when finding an archive that contains different format object files. Return bfd_error_wrong_object_format for this case. * format.c: Formatting fixes. s/CONST/const/. (bfd_check_format_matches): Accept archives that give bfd_error_wrong_object_format if no full match is found. Tidy code handling matching_vector. Don't return a pointer to freed memory in `matching'. Handle ambiguous matches as for partial archive matches. * bfd-in2.h: Regenerate.
* Update copyright noticesNick Clifton2001-03-081-1/+2
|
* 2001-01-23 Kazu Hirata <kazu@hxi.com>Kazu Hirata2001-01-231-37/+35
| | | | | | | | | | | | | | | | | * aoutx.h: Fix formatting. * bfd.c: Likewise. * bfd-in2.h: Likewise. * bfd-in.h: Likewise. * cpu-i386.c: Likewise. * cpu-m68hc11.c: Likewise. * dwarf2.c: Likewise. * elf64-x86-64.c: Likewise. * format.c: Likewise. * freebsd.h: Likewise. * hash.c: Likewise. * hp300hpux.c: Likewise. * hppabsd-core.c: Likewise. * hpux-core.c: Likewise.
* Fix formattingNick Clifton2000-07-201-116/+145
|
* Initial revisionRichard Henderson1999-05-031-0/+342