summaryrefslogtreecommitdiff
path: root/bfd/peXXigen.c
AgeCommit message (Collapse)AuthorFilesLines
2014-11-17Applies a series of patches for PR 17512 and 17533 which fix invalid memory ↵Nick Clifton1-56/+164
accesses. 2014-11-13 Nick Clifton <nickc@redhat.com> PR binutils/17512 * config/obj-coff.c (coff_obj_symbol_new_hook): Set the is_sym field. 2014-11-14 Nick Clifton <nickc@redhat.com> PR binutils/17512 * dwarf.c (get_encoded_value): Add an 'end' parameter. Change the 'data' parameter to a double pointer and return the updated value. (decode_location_expression): Update call to get_encoded_value. (frame_need_space): Handle the case where one or both of the mallocs fails. (read_cie): Initialise the cie pointer, even if the read fails. (display_debug_frames): Warn if the calculated block_end is before the start of the block. Break the loop if the CIE could not be read. Update call to get_encoded_value. Warn if the read CFA expressions are too big. 2014-11-13 Nick Clifton <nickc@redhat.com> PR binutils/17531 * readelf.c (process_version_sections): If the read of the version def information fails, make sure that the external verdef data is not used. (get_dynamic_data): Do not attempt to allocate memory for more dynamic data than there is in the file. If the read fails, free the allocated buffer. (process_symbol_table): Do not print dynamic information if we were unable to read the dynamic symbol table. (print_gnu_note): Do not print the note if the descsz is too small. 2014-11-12 Nick Clifton <nickc@redhat.com> PR binutils/17512 * dwarf.c (read_and_display_attr_value): Check that we do not read past end. (display_debug_pubnames_worker): Add range checks. (process_debug_info): Check for invalid pointer sizes. (display_loc_list): Likewise. (display_loc_list_dwo): Likewise. (display_debug_ranges): Likewise. (display_debug_aranges): Check for invalid address size. (read_cie): Add range checks. Replace call strchr with while loop. * objdump.c (dump_dwarf): Replace abort with a warning message. (print_section_stabs): Improve range checks. * rdcoff.c (coff_get_slot): Use long for indx parameter type. Add check for an excesively large index. * rddbg.c (read_section_stabs_debugging_info): Zero terminate the string table. Avoid walking off the end of the stabs data. * stabs.c (parse_stab_string): Add check for a NULL name. 2014-11-11 Nick Clifton <nickc@redhat.com> PR binutils/17531 * binutils/readelf.c (dynamic_nent): Change type to size_t. (slurp_rela_relocs): Use size_t type for nrelas. (slurp_rel_relocs): Likewise. (get_program_headers): Improve out of memory error message. (get_32bit_section_headers): Likewise. (get_32bit_section_headers): Likewise. (get_64bit_section_headers): Likewise. (get_32bit_elf_symbols): Likewise. (get_64bit_elf_symbols): Likewise. (process_section_groups): Likewise. (get_32bit_dynamic_section): Likewise. (get_64bit_dynamic_section): Likewise. (process_dynamic_section): Likewise. (process_version_sections): Likewise. (get_symbol_index_type): Likewise. (process_mips_specific): Likewise. (process_corefile_note_segment): Likewise. (process_version_sections): Use size_t type for total. (get_dynamic_data): Change type of number parameter to size_t. Improve out of memory error messages. (process_symbol_table): Change type of nbuckets and nchains to size_t. Skip processing of sections headers if there are none. Improve out of memory error messages. 2014-11-11 Nick Clifton <nickc@redhat.com> PR binutils/17531 * readelf.c (display_arm_attribute): Avoid reading off the end of the buffer when processing a Tag_nodefaults. 2014-11-10 Nick Clifton <nickc@redhat.com> PR binutils/17531 * readelf.c (ia64_process_unwind): Replace assertion with an error message. Add range checking for group section indicies. (hppa_process_unwind): Replace assertion with an error message. (process_syminfo): Likewise. (decode_arm_unwind_bytecode): Add range checking. (dump_section_as_strings): Add more string range checking. (display_tag_value): Likewise. (display_arm_attribute): Likewise. (display_gnu_attribute): Likewise. (display_tic6x_attribute): Likewise. (display_msp430x_attribute): Likewise. 2014-11-10 Nick Clifton <nickc@redhat.com> PR binutils/17552 * objcopy.c (copy_archive): Clean up temporary files even if an error occurs. 2014-11-07 Nick Clifton <nickc@redhat.com> PR binutils/17531 * readelf.c (get_data): Avoid allocating memory when we know that the read will fail. (find_section_by_type): New function. (get_unwind_section_word): Check for invalid symbol indicies. Check for invalid reloc types. (get_32bit_dynamic_section): Add range checks. (get_64bit_dynamic_section): Add range checks. (process_dynamic_section): Check for a corrupt time value. (process_symbol_table): Add range checks. (dump_section_as_strings): Add string length range checks. (display_tag_value): Likewise. (display_arm_attribute): Likewise. (display_gnu_attribute): Likewise. (display_tic6x_attribute): Likewise. (display_msp430x_attribute): Likewise. (process_mips_specific): Add range check. 2014-11-06 Nick Clifton <nickc@redhat.com> PR binutils/17552, binutils/17533 * bucomm.c (is_valid_archive_path): New function. Returns false for absolute pathnames and pathnames that include /../. * bucomm.h (is_valid_archive_path): Add prototype. * ar.c (extract_file): Use new function to check for valid pathnames when extracting files from an archive. * objcopy.c (copy_archive): Likewise. * doc/binutils.texi: Update documentation to mention the limitation on pathname of archive members. 2014-11-05 Nick Clifton <nickc@redhat.com> PR binutils/17531 * readelf.c (printable_section_name): New function. (printable_section_name_from_index): New function. (dump_relocations): Use new function. (process_program_headers, get_32bit_elf_symbols, (get_64bit_elf_symbols, process_section_headers, (process_section_groups, process_relocs, ia64_process_unwind, (hppa_process_unwind, get_unwind_section_word, decode_arm_unwind, (arm_process_unwind, process_version_sections, (process_symbol_table, apply_relocations, get_section_contents, (dump_section_as_strings, dump_section_as_bytes, (display_debug_section, process_attributes, process_mips_specific, (process_mips_specific process_gnu_liblist): Likewise. (get_unwind_section_word): Check for a missing symbol table. Replace aborts with error messages. (arm_process_unwind): Check for a missing string table. (process_attributes): Check for an attribute length that is too small. (process_mips_specific): Check for a corrupt GOT symbol offset. 2014-11-05 Nick Clifton <nickc@redhat.com> PR binutils/17533 * bucomm.c (is_valid_archive_path): New function. * bucomm.h (is_valid_archive_path): Prototype it. * ar.c (extract_file): Call is_valid_archive_path to verify a member filename before extracting it. * objcopy.c (copy_archive): Likewise. 2014-11-04 Nick Clifton <nickc@redhat.com> PR binutils/17531 * readelf.c (get_data): If the reason parameter is null, do not print any error messages. (get_32bit_section_headers): Verify section header entry size before reading in the section headers. (get_64bit_section_headers): Likewise. (process_section_headers): Pass FALSE to get_section_headers. (get_file_header): Pass TRUE to get_section_headers. (process_dynamic_section): Change an assert to an error message. (process_symbol_table): Handle corrupt histograms. (get_32bit_program_headers): Verify program header entry size before reading in the program headers. (get_64bit_program_headers): Likewise. (get_unwind_section_word): Do nothing if no section was provided. Fail if the offset is outside of the section. (print_dynamic_symbol): Catch out of range symbol indicies. (process_mips_specific): Likewise. (process_attributes): Make sure that there is enough space left in the section before attempting to read the length of the next attribute. 2014-11-03 Nick Clifton <nickc@redhat.com> PR binutils/17512 * objdump.c (slurp_symtab): Fail gracefully if the table could not be read. (dump_relocs_in_section): Likewise. 2014-11-14 Nick Clifton <nickc@redhat.com> PR binutils/17597 * opncls.c (bfd_get_debug_link_info): Avoid reading off the end of the section. (bfd_get_alt_debug_link_info): Likewise. 2014-11-14 Nick Clifton <nickc@redhat.com> PR binutils/17512 * ieee.c (ieee_archive_p) Skip processing if no bytes are read at all. (ieee_object_p): Likewise. 2014-11-13 H.J. Lu <hongjiu.lu@intel.com> * coffcode.h (coff_slurp_line_table): Add cast to unsigned int. 2014-11-13 H.J. Lu <hongjiu.lu@intel.com> * coffcode.h (coff_pointerize_aux_hook): Fix a typo. 2014-11-13 Nick Clifton <nickc@redhat.com> PR binutils/17512 * coffcode.h (coff_ptr_struct): Add is_sym field. (coff_new_section_hook): Set the is_sym field. (coff_pointerize_aux_hook): Check the is_sym field. (coff_print_aux): Likewise. (coff_compute_section_file_positions): Likewise. (coff_write_object_contents): Likewise. (coff_slurp_line_table): Likewise. (coff_slurp_symbol_table): Likewise. (CALC_ADDEND): Likewise. * coffgen.c (coff_renumber_symbols): Likewise. (coff_mangle_symbols): Likewise. (coff_fix_symbol_name): Likewise. (coff_write_symbol): Likewise. (coff_write_alien_symbol): Likewise. (coff_write_native_symbol): Likewise. (coff_write_symbols): Likewise. (coff_write_linenumbers): Likewise. (coff_pointerize_aux): Likewise. (coff_get_normalized_symtab): Likewise. (coff_get_symbol_info): Likewise. (bfd_coff_get_syment): Likewise. (bfd_coff_get_auxent): Likewise. (coff_print_symbol): Likewise. (coff_find_nearest_line_with_names): Likewise. (bfd_coff_set_symbol_class): Likewise. (coff_make_empty_symbol): Set the is_sym field. (coff_bfd_make_debug_symbol): Likewise. * peicode.h (pe_ILF_make_a_symbol): Likewise. * libcoff.h: Regenerate. * libcoff-in.h: Regenerate. 2014-11-12 Nick Clifton <nickc@redhat.com> PR binutils/17512 * coffcode.h (coff_slurp_line_table): Set the line number of corrupt entries to -1. (coff_slurp_symbol_table): Alway initialise the value of the symbol. * coffgen.c (coff_print_symbol): Check that the combined pointer is valid. (coff_print_symbol): Do not print negative line numbers. * peXXigen.c (pe_print_idata): Add range checking displaying member names. 2014-11-12 Alan Modra <amodra@gmail.com> PR binutils/17512 * coffcode.h (coff_slurp_line_table): Drop line number info not preceded by a valid function entry. Revert last change. 2014-11-11 Nick Clifton <nickc@redhat.com> PR binutils/17512 * coffcode.h (coff_slurp_line_table): Initialise the parts of the line number cache that would not be initialised by the copy from the new line number table. (coff_classify_symbol): Allow for _bfd_coff_internal_syment_name returning NULL. * coffgen.c (coff_get_normalized_symbols): Get the external symbols before allocating space for the internal symbols, in case the get fails. * elf.c (_bfd_elf_slurp_version_tables): Only allocate a verref array if one is needed. Likewise with the verdef array. * peXXigen.c (_bfd_XXi_swap_sym_in): Replace abort()'s with error messages. (_bfd_XXi_swap_aux_in): Make sure that all fields of the aux structure are initialised. (pe_print_edata): Avoid reading off the end of the data buffer. 2014-11-11 Alan Modra <amodra@gmail.com> PR binutils/17512 * coffcode.h (coff_slurp_line_table): Use updated lineno_count when building func_table. 2014-11-11 Alan Modra <amodra@gmail.com> PR binutils/17512 * coffcode.h (coff_slurp_line_table): Don't bfd_zalloc, just memset the particular bits we need. Update src after hitting loop "continue". Don't count lineno omitted due to invalid symbols in nbr_func, and update lineno_count. Init entire terminating lineno. Don't both allocating terminator in n_lineno_cache. Redirect sym->lineno pointer to where n_lineno_cache will be copied, and free n_lineno_cache. * pe-mips.c (NUM_HOWTOS): Typo fix. 2014-11-10 Nick Clifton <nickc@redhat.com> PR binutils/17521 * coff-i386.c (NUM_HOWTOS): New define. (RTYPE2HOWTO): Use it. (coff_i386_rtype_to_howto): Likewise. (coff_i386_reloc_name_lookup): Likewise. (CALC_ADDEND): Check that reloc r_type field is valid. * coff-x86_64.c (NUM_HOWTOS): New define. (RTYPE2HOWTO): Use it. (coff_amd64_rtype_to_howto): Likewise. (coff_amd64_reloc_name_lookup): Likewise. (CALC_ADDEND): Check that reloc r_type field is valid. * coffcode.h (coff_slurp_line_table): Check for symbol table indexing underflow. (coff_slurp_symbol_table): Use zalloc to ensure that all table entries are initialised. * coffgen.c (_bfd_coff_read_string_table): Initialise unused bits in the string table. Also ensure that the table is 0 terminated. (coff_get_normalized_symtab): Check for symbol table indexing underflow. * opncls.c (bfd_alloc): Catch the case where a small negative size can result in only 1 byte being allocated. (bfd_alloc2): Use bfd_alloc. * pe-mips.c (NUM_HOWTOS): New define. (coff_mips_reloc_name_lookup): Use it. (CALC_ADDEND): Check that reloc r_type field is valid. * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Initialise unused entries in the DataDirectory. (pe_print_idata): Avoid reading beyond the end of the data block wen printing strings. (pe_print_edata): Likewise. Check for table indexing underflow. * peicode.h (pe_mkobject): Initialise the pe_opthdr field. (pe_bfd_object_p): Allocate and initialize enough space to hold a PEAOUTHDR, even if the opt_hdr field specified less. 2014-11-08 Alan Modra <amodra@gmail.com> * peXXigen.c (pe_print_idata): Revert last patch, cast lhs instead. 2014-11-07 H.J. Lu <hongjiu.lu@intel.com> * peXXigen.c (pe_print_idata): Cast to unsigned long in range checks. 2014-11-07 Alan Modra <amodra@gmail.com> * tekhex.c (tekhex_set_arch_mach): Ignore unknown arch errors. 2014-11-07 Alan Modra <amodra@gmail.com> * tekhex.c (CHUNK_SPAN): Define. (struct data_struct <chunk_init>): Use one byte per span, update all code accessing this field. (find_chunk): Add create param, don't create new entry unless set. (insert_byte): Don't save zeros. (first_phase): Set section SEC_CODE or SEC_DATA flag depending on symbol type. Create an alternate section if both types of symbol are given. Attach type '2' and '6' symbols to absolute section. (move_section_contents): Fix caching of chunk. Don't create chunk when reading, or for writing zeros. (tekhex_set_section_contents): Don't create initial chunks. (tekhex_write_object_contents): Use CHUNK_SPAN. 2014-11-07 Alan Modra <amodra@gmail.com> * aoutx.h (aout_get_external_symbols): Tidy allocation of symbol buffer. 2014-11-07 Alan Modra <amodra@gmail.com> * archive.c (_bfd_slurp_extended_name_table): Revert bfd_get_size check. * coffcode.h (coff_set_alignment_hook): Likewise. (coff_slurp_line_table): Likewise. * coffgen.c (coff_get_normalized_symtab): Likewise. (_bfd_coff_get_external_symbols): Likewise. * elf.c (bfd_elf_get_str_section): Likewise. * tekhex.c (first_phase): Likewise. 2014-11-06 Nick Clifton <nickc@redhat.com> * aoutx.h (slurp_symbol_table): Revert previous delta. (slurp_reloc_table): Likewise. * compress.c (bfd_get_full_section_contents): Remove file size test. * coffgen.c (coff_get_normalized_symtab): Allow zero-sized symtabs and do not complain about linker generated files. 2014-11-04 Nick Clifton <nickc@redhat.com> PR binutils/17512 * coffcode.h (handle_COMDAT): Replace abort with BFD_ASSERT. Replace another abort with an error message. (coff_slurp_line_table): Add more range checking. * peXXigen.c (pe_print_debugdata): Add range checking. 2014-11-05 Nick Clifton <nickc@redhat.com> PR binutils/17512 * coffcode.h (coff_set_alignment_hook): Warn if the file lies about the number of relocations it contains. (coff_sort_func_alent): Return 0 if the pointers are NULL. (coff_slurp_line_table): Add more range checks. Do not free new tables created when sorting line numbers. * peXXigen.c (pe_print_idata): Add range checks. (pe_print_edata): Likewise. (rsrc_print_resource_entries): Likewise. Avoid printing control characters. Terminate priniting if corruption is detected. (rsrc_print_resource_directory): Terminate printing if an unknown directory type is encountered. (pe_print_debugdata): Fix off-by-one error. (rsrc_count_entries): Add range checking. (rsrc_parse_entry): Likewise. 2014-11-04 Nick Clifton <nickc@redhat.com> PR binutils/17512 * compress.c (bfd_get_full_section_contents): Improve test for linker created objects. PR binutils/17533 * archive.c (_bfd_slurp_extended_name_table): Handle archives with corrupt extended name tables. 2014-11-03 Nick Clifton <nickc@redhat.com> PR binutils/17512 * aoutx.h (slurp_symbol_table): Check that computed table size is not bigger than the file from which is it being read. (slurp_reloc_table): Likewise. * coffcode.h (coff_slurp_line_table): Remove unneeded local 'warned'. Do not try to print the details of a symbol with an invalid index. * coffgen.c (make_a_sectiobn_from_file): Check computed string index against length of string table. (bfd_coff_internal_syment_name): Check read in string offset against length of string table. (build_debug_section): Return a pointer to the section used. (_bfd_coff_read_string_table): Store the length of the string table in the coff_tdata structure. (bfd_coff_free_symbols): Set the length of the string table to zero when it is freed. (coff_get_normalized_symtab): Check offsets against string table or data table lengths as appropriate. * cofflink.c (_bfd_coff_link_input_bfd): Check offset against length of string table. * compress.c (bfd_get_full_section_contents): Check computed size against the size of the file. * libcoff-in.h (obj_coff_strings_len): Define. (struct coff_tdata): Add strings_len field. * libcoff.h: Regenerate. * peXXigen.c (pe_print_debugdata): Do not attempt to print the data if the debug section is too small. * xcofflink.c (xcoff_link_input_bfd): Check offset against length of string table. 2014-10-31 Nick Clifton <nickc@redhat.com> PR binutils/17512 * coffgen.c (_bfd_coff_get_external_symbols): Do not try to load a symbol table bigger than the file. * elf.c (bfd_elf_get_str_section): Do not try to load a string table bigger than the file. * tekhex.c (first_phase): Check that the section range is sane.
2014-10-28Fixes another couple of memory errors reading corrupt binaries. This timeNick Clifton1-0/+9
detected by the address sanitizer. PR binutils/17512 * elf.c (bfd_section_from_shdr): Allocate and free the recursion detection table on a per-bfd basis. * peXXigen.c (pe_print_edata): Handle binaries with a truncated export table.
2014-10-28Import patches from the master branch which prevent seg-faults when parsingNick Clifton1-2/+27
corrupt binaries. 2014-10-28 Andreas Schwab <schwab@suse.de> Nick Clifton <nickc@redhat.com> PR binutils/17510 * srec.c (srec_bad_byte): Increase size of buf to allow for negative values. (srec_scan): Use an unsigned char buffer to hold header bytes. 2014-10-27 Nick Clifton <nickc@redhat.com> PR binutils/17512 * elf.c (bfd_section_from_shdr): Detect and warn about ELF binaries with a group of sections linked by the string table indicies. * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Handle corrupt binaries with an invalid value for NumberOfRvaAndSizes. (pe_print_edata): Detect out of range rvas and entry counts for the Export Address table, Name Pointer table and Ordinal table. PR binutils/17510 * elf.c (setup_group): Improve handling of corrupt group sections.
2014-08-14Fix for objdump segfault on broken PE executableAlan Modra1-17/+20
* peXXigen.c (pe_print_reloc): Protect against access past end of .reloc section.
2014-06-13Make bfd.link_next field a unionAlan Modra1-1/+1
This field of struct bfd is currently only used to chain together linker input files. This patch prepares to use the field to stash the linker hash table, which is always created on the linker output file. bfd/ * bfd.c (struct bfd): Replace link_next with a union. * aoutx.h, * bfd.c, * coff-ppc.c, * coff-rs6000.c, * cofflink.c, * ecoff.c, * elf-m10300.c, * elf32-arm.c, * elf32-avr.c, * elf32-hppa.c, * elf32-i386.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc1x.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-nds32.c, * elf32-nios2.c, * elf32-or1k.c, * elf32-ppc.c, * elf32-rl78.c, * elf32-s390.c, * elf32-score.c, * elf32-score7.c, * elf32-sh.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilepro.c, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-x86-64.c, * elflink.c, * elfnn-aarch64.c, * elfxx-mips.c, * elfxx-sparc.c, * elfxx-tilegx.c, * linker.c, * pdp11.c, * peXXigen.c, * simple.c, * sunos.c, * vms-alpha.c, * xcofflink.c: Update for above. * bfd-in2.h: Regenerate. include/ * bfdlink.h: Update for bfd.link_next change. ld/ * emultempl/cr16elf.em, * emultempl/elf32.em, * emultempl/genelf.em, * emultempl/m68kcoff.em, * emultempl/m68kelf.em, * emultempl/nds32elf.em, * emultempl/pe.em, * emultempl/pep.em, * ldlang.c, * ldmain.c, * pe-dll.c: Update for bfd.link_next change.
2014-06-03This is to fix a further problem with merging resource sections. It turnsNick Clifton1-2/+30
out that the section is supposed to be page-aligned, but the newly merged section was not being padded out to a page boundary. This meant that when the executable was stripped a badly sized .rsrc section was written out. PR ld/16807 * peXXigen.c (rsrc_process_section): Page align the new contents befgore writing out.
2014-05-16This fixes a few issues with pe/coff build-ids that were discovered since theJon Turney1-3/+79
original patches were posted: pe/coff: Display GUID build-id in the conventional way pe/coff: Don't interpret debug directory in section with no contents pe/coff: Keep .build-id with --only-keep-debug pe/coff: Don't break .build-id with objcopy/strip * peXXigen.c (pe_print_debugdata): Don't interpret debug directory in a section with no contents. (is_vma_in_section, find_section_by_vma): New functions. (_bfd_XX_bfd_copy_private_bfd_data_common): Recalculate file offsets in the debug directory. (_bfd_XXi_slurp_codeview_record, _bfd_XXi_write_codeview_record): Byte-swap GUID from little-endian to big-endian order for consistent and conventional display. * objcopy.c (is_nondebug_keep_contents_section): New function. (setup_section): Use it.
2014-04-28This patch reworks the fix to avoid a compile time warning so that it will workNick Clifton1-9/+6
with later versions of gcc. PR ld/16821 * peXXigen.c (_bfd_XXi_swap_sym_out): Rework fix to avoid compile time warning.
2014-04-25This fixes a compile time warning which is being treated as an error. OlderNick Clifton1-1/+9
versions of gcc complain about part of a conditional expression always evaluating to false because of the size of the operands involved, even when the entire expression is already known to be false. * peXXigen.c (_bfd_XXi_swap_sym_out): Another fix for building on a 342-bit host. This time for older versions of gcc.
2014-04-24 * peXXigen.c (rsrc_print_section): Fix compile time warning forNick Clifton1-2/+4
32-bit hosts.
2014-04-24Fix PE/COFF resource merging problems. There were two issues:Nick Clifton1-77/+128
1. Strings (and then resource data) must follow immediately after the end of the tables. 2. Units of resource data must be 8-byte aligned. PR ld/16807 * peXXigen.c (struct rsrc_regions): New structure. (rsrc_print_resource_directory): Use new structure. Include offset of directory in listing. (rsrc_print_resource_entry): Likewise. (rsrc_print_section): Likewise. (rsrc_count_entries): Do not increment sizeof_strings or sizeof_leaves. (rsrc_count_directory): Do not increment sizeof_tables. (rsrc_compute_region_sizes): New function. (rsrc_write_leaf): Maintain 8-byte alignment for resource data. (rsrc_process_section): Compute size of regions after merging entries.
2014-04-22Another fix for building on a 32-bit host.Nick Clifton1-1/+1
PR ld/16821 * peXXigen.c (_bfd_XXi_swap_sym_out): Fix for 32-bit hosts.
2014-04-22Fix build problem on 32-bit hosts with the recent patch for PR 16821.Yuanhui Zhang1-1/+9
PR ld/16821 * peXXigen.c (abs_finder): Fix for 32-bit host builds.
2014-04-11PE32+ binaries that use addresses > 1^32 have a problem in that the linkerNick Clifton1-0/+31
converts some address expressions into absolute values, but the PE format only stores absolutes as 32-bits. This is a partial solution which attempts to convert such absolute values back to section relative ones instead. It fails for symbols like __image_base and ImageBase__, but it is unclear as to whether these values are ever actually used by applications. PR ld/16821 * peXXigen.c (abs_finder): New function. (_bfd_XXi_swap_sym_out): For absolute symbols with values larger than 1^32 try to convert them into section relative values instead.
2014-04-08Add support for generating and inserting build IDs into COFF binaries.Jon TURNEY1-3/+215
* peXXigen.c (pe_print_debugdata): New function: Displays the contents of the debug directory and decodes codeview entries. (_bfd_XXi_swap_debugdir_in, _bfd_XXi_swap_debugdir_out) (_bfd_XXi_slurp_codeview_record, _bfd_XXi_write_codeview_record): Add functions for reading and writing debugdir and codeview records. * libpei.h (_bfd_XXi_swap_debugdir_in, _bfd_XXi_swap_debugdir_out) (_bfd_XXi_write_codeview_record): Add prototypes and macros. * libcoff-in.h (pe_tdata): Add build-id data. * libcoff.h: Regenerate. * coffcode.h (coff_write_object_contents): Run build_id after_write_object_contents hook. * pe.h (external_IMAGE_DEBUG_DIRECTORY, _CV_INFO_PDB70) (_CV_INFO_PDB20): Add structures and constants for debug directory and codeview records. * internal.h (internal_IMAGE_DEBUG_DIRECTORY, CODEVIEW_INFO): Add structures and constants for internal representation of debug directory and codeview records. * emultempl/elf32.em (id_note_section_size, read_hex, write_build_id): Move code for parsing build-id option and calculating the build-id to... * ldbuildid.c: New file. * ldbuildid.h: New file. * Makefile.am (CFILES, HFILES, OFILES, ld_new_SOURCES): Add new files. * Makefile.in: Regenerate. * ld.texinfo: Update --build-id description to mention COFF support. * NEWS: Mention support for COFF build ids. * emultempl/pe.em (gld${EMULATION_NAME}_handle_option): (pecoff_checksum_contents, write_build_id, setup_build_id) (gld_${EMULATION_NAME}_after_open): Handle and implement build-id option. * emultempl/pep.em: Likewise.
2014-04-03 * peXXigen.c (pe_print_edata): Verify edt.name lies insideJon Turney1-10/+25
section before dereferencing. (pe_print_idata, pe_print_edata, pe_print_reloc) (rsrc_print_section): Don't bother interpreting the contents of sections which have no contents.
2014-03-19Improve .rsrc section merging again. This time with an algorithm thatNick Clifton1-65/+59
should work for all types of input .rsrc section. * peXXigen.c (rsrc_process_section): Add code to scan input sections and record their lengths. Use these lengths to find the start of each merged .rsrc section. * scripttempl/pe.sc (R_RSRC): Fix default-manifest exclusion. (.rsrc): Add SUBALIGN(4). Remove SORT. * scripttempl/pep.sc: Likewise.
2014-03-19Improve .rsrc section merging with better handling of the alignment adjustmentsNick Clifton1-10/+61
made between merged .rsrc sections. * peXXigen.c (rsrc_align): New function. Attempts to cope with alignment variances when .rsrc sections are merged. (rsrc_process_section): Use rsrc_align. * Makefile.am (default-manifest.o): Use WINDRES_FOR_TARGET. * Makefile.in: Regenerate. * emultempl/default-manifest.rc: Fix typo. * scripttempl/pe.sc (R_RSRC): Fix default-manifest exclusion. (.rsrc): Add SUBALIGN(4). * scripttempl/pep.sc: Likewise.
2014-03-05Update copyright yearsAlan Modra1-1/+1
2013-12-30 * peXXigen.c (rsrc_process_section): Use ptrdiff_t as the type forIlya Tocar1-2/+2
pointer arithmetic.
2013-12-19 * Fix indentation issue and reorganize last commit entryPierre Muller1-19/+20
so that it is shorter than 80. peXXigen.c (rsrc_cmp): Fix unused variable warning.
2013-12-19 * peXXigen.c (u16_mbtouc): Avoid unused function warning by excluding ifPierre Muller1-75/+114
__CYGWIN__ or __MINGW32__ macro is defined. (rsrc_cmp): Fix Windows host version and version without wchar header. [__CYGWIN__, __MINGW32__]: Introduce rsrccmp macro. Fix coding standard issues.
2013-12-18 * peXXigen.c (rsrc_print_section): Use ptrdiff_t as the type forNick Clifton1-1/+1
pointer arithmetic.
2013-12-17Rename index to indxH.J. Lu1-8/+8
* peXXigen.c (rsrc_process_section): Rename index to indx.
2013-12-17 * peXXigen.c: Include wchar.h if available.Nick Clifton1-79/+1195
Include safe-ctype.h. (HighBitSet, SetHighBit, WithoutHighBit): New macros. (pe_print_resource_entries): Rename to rsrc_print_resource_entries. Handle names that are not RVAs. (pe_print_resource_directory): Rename to rsrc_print_resource_directory. (pe_print_rsrc): Rename to rsrc_print_section. Corrupt computation of RVA bias. (rsrc_count_entries): New function. (rsrc_count_directory): New function. (rsrc_parse_entry): New function. (rsrc_parse_entries): New function. (rsrc_parse_directory): New function. (rsrc_write_string): New function. (rsrc_compute_rva): New function. (rsrc_write_leaf): New function. (rsrc_write_entry): New function. (rsrc_write_directory): New function. (u16_mbtouc): New function. (rsrc_cmp): New function. (rsrc_print_name): New function. (rsrc_resource_name): New function. (rsrc_merge_string_entries): New function. (rsrc_sort_entries): New function. (rsrc_attach_chain): New function. (rsrc_merge): New function. (rsrc_process_section): New function - merges the contents of a .rsrc section. (_bfd_XXi_final_link_postscript): Call rsrc_process_section. * configure.in (AC_CHECK_HEADERS): Add wchar.h * config.in: Regenerate. * configure: Regenerate.
2013-12-03 * peXXigen.c (pe_print_resource_entries): New function: DisplaysNick Clifton1-0/+210
an entry in a .rsrc section. (pe_print_resource_directory): New function: Displays a directory in a .rsrc section. (pe_print_rsrc): New function: Displays the contents of .rsrc section. (_bfd_XX_print_private_bfd_data_common): Call pe_print_rsrc. * binutils-all/windres/windres.exp: Run for x86_64-pc-cygwin. Add test of "objump -p" output.
2013-11-22 * windres.c (define_resource): Use zero for timestamp, makingCory Fields1-3/+5
output deterministic. time.h include is no longer needed. * resres.c (res_append_resource): Likewise. * pe-dll.c (fill_edata): Only use a real timestamp if --insert-timestamp was used. * emultempl/pe.em: Add the --insert-timestamp option. * emultempl/pep.em: Likewise for 64bit. * ld.texinfo: Document the --insert-timestamp option. * libcoff-in.h: Add insert_timestamp flag to the pe_data struct. * libcoff.h: Regenerate. * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Only use a real timestamp if --insert-timestamp was used.
2013-03-21 * coffgen.c (coff_real_object_p): Make global.Kai Tietz1-1/+1
* peicode.h (coff_real_object_p): Add prototype. (FILHDR): Defined for COFF_IMAGE_WITH_PE as external_PEI_IMAGE_hdr structure. (coff_swap_filehdr_in): Handle variable header-size. * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Just handle amount of directory-entiries as specified in pe-header.
2013-01-10Remove trailing white spaces in bfdH.J. Lu1-1/+1
* 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.
2012-10-18ChangeLog bfdKai Tietz1-3/+0
2012-10-18 Kai Tietz <ktietz@redhat.com> PR binutils/14067 * coff-i386.c (bfd_target): Add section flag SEC_EXCLUDE. Allow BFD_COMPRESS and BFD_DECOMPRESS flags. * coff-x86_64.c: Likewise. * coffcode.h (DOT_ZDEBUG): New define. (sec_to_styp_flags): Check for .zdebug. (styp_to_sec_flags): Likewise. * coffgen.c (make_a_section): Handle .debug_* section compression/decompression flags. * cofflink.c (mark_relocs): Ignore relocations for a section, which isn't marked as used. (_bfd_coff_link_input_bfd): Add support of compressed debug sections. * compress.c (decompress_contents): Loop as long as there is input available and there is room for output. * bfd/pe-arm.c: Add .zdebug_ partial match entry. * pe-i386.c: Likewise. * pe-x86_64.c: Likewise. * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Don't clear all data-directories as this might destroy content. * coff-i386.c (_bfd_generic_find_nearest_line_discriminator): define as coff_find_nearest_line_discriminator. * libcoff-in.h (coff_find_nearest_line_discriminator): New * libcoff.h: Regenerated. * coff-x86_64.c: Likewise. * coffgen.c (coff_find_nearest_line_discriminator): New function. prototype. ChangeLog binutils 2012-10-18 Kai Tietz <ktietz@redhat.com> * objdump.c (dump_bfd): Call dump headers after call of slurp_symtab. ChangeLog ld 2012-10-18 Kai Tietz <ktietz@redhat.com> PR binutils/14067 * NEWS: Menition new feature. * scripttempl/pep.sc: Add zdebug sections. * scripttempl/pe.sc: L
2011-04-092011-04-09 Kai Tietz <ktietz@redhat.com>Kai Tietz1-7/+15
* peXXigen.c (_bfd_XXi_final_link_postscripte): Sort pdata in temporary buffer and use rawsize for sorting. * coffcode.h (coff_compute_section_file_positions): Set rawsize before doing alignment.
2010-12-212010-12-21 Kai Tietz <kai.tietz@onevision.com>Kai Tietz1-1/+3
* peXXigen.c (_bfd_XXi_final_link_postscript): Use bfd_get_symbol_leading_char to determine "_tls_used" name. 2010-12-21 Kai Tietz <kai.tietz@onevision.com> * ld-pe/pe.exp: Add TLS directory test. * ld-pe/tlssec.s: New. * ld-pe/tlssec64.d: New. * ld-pe/tlssec32.d: New.
2010-12-21 * peXXigen.c (_bfd_XXi_final_link_postscript): Use correct sizePierre Muller1-1/+8
for windows 64-bit TLS table size.
2010-09-222010-09-22 Kai Tietz <kai.tietz@onevision.com>Kai Tietz1-0/+43
* peXXigen.c (_bfd_XXi_final_link_postscript): Add handling for setting IAT directory entry.
2010-09-142010-09-14 Kai Tietz <kai.tietz@onevision.com>Kai Tietz1-0/+37
* peXXigen.c (sort_x64_pdata): New helper. (_bfd_XXi_final_link_postscript): Do pdata sorting.
2010-09-06 * peXXigen.c: Whitespace.Alan Modra1-58/+48
(pe_print_idata): Correct section limit calculations. Tidy array indexing. (_bfd_XX_print_ce_compressed_pdata): Don't leak memory.
2010-06-27fix set but unused variable warningsAlan Modra1-0/+4
2010-04-09bfd/ChangeLogNick Clifton1-3/+1
2010-04-09 Nick Clifton <nickc@redhat.com> * aoutx.h (aout_link_input_bfd): Remove unused variable sym_count. * elf-eh-frame.c (_bfd_elf_eh_frame_section_offset): Remove unused variables htab and hdr_info and mark info parameter as unused. * elf.c (prep_headers): Remove unused variable i_phdrp. (_bfd_elf_write_object_contents): Remove unused variable i_ehdrp. * elf32-i386.c (elf_i386_relocate_section): Mark variabled warned as unused. * peXXigen.c (pe_print_reloc): Remove unused variable datasize. * verilog.c (verilog_write_section): Remove unused variable address. binutils/ChangeLog 2010-04-09 Nick Clifton <nickc@redhat.com> * dwarf.c (process_debug_info): Remove unused variable cu_abbrev_offset_ptr. (display_debug_lines_decoded): Remove unused variable prev_line. * elfedit.c (process_archive): Remove unused variable file_name_size. * ieee.c (ieee_start_compilation_unit): Remove unused variable nindx. (ieee_set_type): Remove unused variables info, targetindx and baseindx. * objdump.c (disassmble_byte): Remove unused variable done_dot. * rddbg.c (read_section_stabs_debugging_info): Remove unused variable other. * readelf.c (dump_section_as_strings): Remove unused variable addr. (process_archive): Remove unused variable file_name_size. * stabs.c (parse_stab_string): Mark desc parameter as unused. Remove unused variable lineno. (parse_stab_struct_type): Remove unused variable orig. (stab_demangle_type): Remove unused variables constp, volatilep and hold. gas/ChangeLog 2010-04-09 Nick Clifton <nickc@redhat.com> * as.c (create_obj_attrs_section): Remove unused variable addr. * listing.c (listing_listing): Remove unused variable message. * read.c: Remove unnecessary register type qualifiers. (s_mri): Only define/use old_flag variable if MRI_MODE_CHANGE is defined. ld/ChangeLog 2010-04-09 Nick Clifton <nickc@redhat.com> * ldlang.c (wild_sort): Remove unused variable section_name. opcodes/ChangeLog 2010-04-09 Nick Clifton <nickc@redhat.com> * i386-dis.c (print_insn): Remove unused variable op. (OP_sI): Remove unused variable mask.
2010-03-18Don't add IMAGE_FILE_RELOCS_STRIPPED for PIE.H.J. Lu1-1/+10
2010-03-18 H.J. Lu <hongjiu.lu@intel.com> PR binutils/11396 * libcoff-in.h (pe_tdata): Add dont_strip_reloc. * libcoff.h: Regenerated. * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Clear F_RELFLG if dont_strip_reloc is set. (_bfd_XX_bfd_copy_private_bfd_data_common): Set dont_strip_reloc on output if there is no .reloc and IMAGE_FILE_RELOCS_STRIPPED isn't set in input.
2009-12-11Add -Wshadow to the gcc command line options used when compiling the binutils.Nick Clifton1-3/+3
Fix up all warnings generated by the addition of this switch.
2009-10-272009-10-27 Kai Tietz <kai.tietz@onevision.com>Kai Tietz1-1/+3
* peXXigen.c (bfdver.h): Add include. (LINKER_VERSION): Do calculation based on BFD_VERSION.
2009-09-09 Updated soruces in bfd/* to compile cleanly with -Wc++-compat.Nick Clifton1-5/+5
* 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.
2009-09-05 * bfd/coff-arm.c (coff_arm_relocate_section)Nick Clifton1-6/+8
(record_thumb_to_arm_glue, bfd_arm_process_before_allocation): Change member name class to symbol_class. * bfd/coff-i960.c (coff_i960_relocate_section) Rename variable class to class_val. Change member name class to symbol_class. * bfd/coff-rs6000.c (_bfd_xcoff_swap_aux_in) (_bfd_xcoff_swap_aux_out): Rename arguments class to in_class. * bfd/coff-stgo32.c (adjust_aux_in_post) (adjust_aux_out_pre, adjust_aux_out_post): Rename arguments class to in_class. * bfd/coff64-rs6000.c (_bfd_xcoff64_swap_aux_in) (_bfd_xcoff64_swap_aux_out): Rename arguments class to in_class. * bfd/coffcode.h (coff_pointerize_aux_hook): Rename variable class to n_sclass. * bfd/coffgen.c (coff_write_symbol, coff_pointerize_aux): Rename variables named class to n_sclass. (coff_write_symbols): Rename variable class to sym_class. (bfd_coff_set_symbol_class): Rename argument class to symbol_class. * bfd/cofflink.c (_bfd_coff_link_hash_newfunc) (coff_link_add_symbols, _bfd_coff_link_input_bfd) (_bfd_coff_write_global_sym, _bfd_coff_generic_relocate_section): Update code to use renamed members. * bfd/coffswap.h (coff_swap_aux_in, coff_swap_aux_out): Rename argument class to in_class. * bfd/libcoff-in.h (struct coff_link_hash_entry, struct coff_debug_merge_type) Renamed members class to symbol_class and type_class. * bfd/libcoff.h Regenerated. * bfd/peXXigen.c: (_bfd_XXi_swap_aux_in, _bfd_XXi_swap_aux_out): Rename argument class to in_class. * bfd/pef.c (bfd_pef_parse_imported_symbol): Update code to use renamed members. * bfd/pef.h (struct bfd_pef_imported_symbol): Changed name of member class to symbol_class. * binutils/ieee.c (ieee_read_cxx_misc, ieee_read_cxx_class) (ieee_read_reference): Rename variables named class to cxxclass. * gas/config/tc-arc.c (struct syntax_classes): Rename member class to s_class. (arc_extinst): Rename variable class to s_class. Update code to use renamed members. * gas/config/tc-mips.c (insn_uses_reg): Rename argument class to regclass. * gas/config/tc-ppc.c (ppc_csect, ppc_change_csect, ppc_function) (ppc_tc, ppc_is_toc_sym, ppc_symbol_new_hook, ppc_frob_label) (ppc_fix_adjustable, md_apply_fix): Update code to use renamed members. * gas/config/tc-ppc.h (struct ppc_tc_sy): Change name of member from class to symbol_class. (OBJ_COPY_SYMBOL_ATTRIBUTES): Update code to use renamed members. * gas/config/tc-score.c (s3_adjust_paritybit): Rename argument class to i_class. * gas/config/tc-score7.c (s7_adjust_paritybit): Rename argument class to i_class. * gprof/corefile.c (core_create_function_syms): Rename variable class to cxxclass. * include/coff/ti.h (GET_LNSZ_SIZE, PUT_LNSZ_SIZE): Updated name of class variable to in_class to match changes in function that use this macro. * include/opcode/ia64.h (struct ia64_operand): Renamed member class to op_class * ld/emultempl/elf32.em (gld${EMULATION_NAME}_load_symbols) (gld${EMULATION_NAME}_try_needed): Rename variable class to link_class * opcodes/ia64-dis.c (print_insn_ia64): Update code to use renamed member. * opcodes/m88k-dis.c (m88kdis): Rename variable class to in_class. * opcodes/tic80-opc.c (tic80_symbol_to_value) (tic80_value_to_symbol): Rename argument class to symbol_class.
2009-05-21 * coffgen.c (coff_print_symbol): Use bfd_fprintf_vma, notDave Korn1-25/+25
fprintf_vma directly. * peXXigen.c (pe_print_edata): Likewise. (pe_print_pdata): Likewise. (_bfd_XX_print_ce_compressed_pdata): Likewise. (_bfd_XX_print_private_bfd_data_common): Likewise.
2009-04-27bfd/H.J. Lu1-1/+1
2009-04-27 H.J. Lu <hongjiu.lu@intel.com> * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Don't copy pe_opthdr. binutils/ 2009-04-27 H.J. Lu <hongjiu.lu@intel.com> * objcopy.c (copy_object): Copy pe_opthdr before changing PE parameters.
2009-04-232009-04-23 Matthias Klose <doko@ubuntu.com>Dave Korn1-1/+1
* bfd/peXXigen.c (_bfd_XXi_swap_sym_in): Initialize `name'.
2009-04-212009-04-21 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu1-11/+0
* coff-ia64.c (COFF_PAGE_SIZE): Changed to 8K. * coffcode.h (coff_compute_section_file_positions): Clear D_PAGED if PE section alignment is smaller than COFF_PAGE_SIZE. * libcoff-in.h (pe_tdata): Remove force_minimum_alignment and force_minimum_alignment. * libcoff.h: Regenerated. * pei-ia64.c (PEI_TARGET_SUBSYSTEM): Removed. (PEI_FORCE_MINIMUM_ALIGNMENT): Likewise. * peicode.h (pe_mkobject): Don't set force_minimum_alignment nor target_subsystem. * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Don't check force_minimum_alignment nor target_subsystem.
2009-04-21bfd/ChangeLogDave Korn1-81/+0
2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff-x86_64.c (PEI_HEADERS): Protect includes. (bfd_pe_print_pdata): Remove #ifdef PE variation. * pei-x86_64.c (PEI_HEADERS): Define to prevent double include in coff-x86_64.c of headers. (PDATA_ROW_SIZE): New define. (pex_regs[]): New static array. (pex64_get_runtime_function): New static function. (pex64_get_unwind_info): Likewise. (pex64_get_scope_entry): Likewise. (pex64_xdata_print_uwd_codes): Likewise. (pep_get_section_by_rva): Likewise. (pex64_dump_xdata): Likewise. (pex64_bfd_print_pdata): Likewise. (bfd_pe_print_pdata): Define as pex64_bfd_print_pdata. * peXXigen.c (_bfd_pex64_print_pdata): Removed implementation. * libpei.h (_bfd_pex64_print_pdata): Removed declaration. include/ChangeLog 2009-04-21 Kai Tietz <kai.tietz@onevision.com> * coff/pe.h (pex64_runtime_function): New structure. (external_pex64_runtime_function): Likewise. (pex64_unwind_code): Likewise. (external_pex64_unwind_code): Likewise. (pex64_unwind_info): Likewise. (external_pex64_unwind_info): Likewise. (external_pex64_scope): Likewise. (pex64_scope): Likewise. (pex64_scope_entry): Likewise. (external_pex64_scope_entry): Likewise. (PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro. (PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise. (PEX64_UNWCODE_CODE): Likewise. (PEX64_UNWCODE_INFO): Likewise. (UWOP_...): Add defines for unwind code. (UNW_FLAG_...): Add defined for unwind info flags. (PEX64_SCOPE_ENTRY_SIZE): New macro. (PEX64_UWI_VERSION): Likewise. (PEX64_UWI_FLAGS): Likewise. (PEX64_UWI_FRAMEREG): Likewise. (PEX64_UWI_FRAMEOFF): Likewise. (PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise. (PEX64_OFFSET_TO_UNWIND_CODE): Likewise. (PEX64_OFFSET_TO_HANDLER_RVA): Likewise. (PEX64_OFFSET_TO_SCOPE_COUNT): Likewise. (PEX64_SCOPE_ENTRY): Likewise.
2009-04-202009-04-19 Peter O'Gorman <binutils@mlists.thewrittenword.com>Alan Modra1-13/+21
Alan Modra <amodra@bigpond.net.au> Dave Korn <dave.korn.cygwin@gmail.com> * peXXigen.c (_bfd_XXi_swap_sym_in): Fix name handling w.r.t long names and non-NUL-terminated strings.
2009-04-17bfd/H.J. Lu1-3/+4
2009-04-17 H.J. Lu <hongjiu.lu@intel.com> * peXXigen.c (_bfd_XX_print_private_bfd_data_common): Replace IMAGE_SUBSYSTEM_EFI_ROM with IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER. binutils/ 2009-04-17 H.J. Lu <hongjiu.lu@intel.com> * objcopy.c (set_pe_subsystem): Replace efi-rom with sal-rtd. * doc/binutils.texi: Likewise. include/coff/ 2009-04-17 H.J. Lu <hongjiu.lu@intel.com> * pe.h (IMAGE_SUBSYSTEM_EFI_ROM): Renamed to ... (IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER): This.