summaryrefslogtreecommitdiff
path: root/bfd/elf.c
Commit message (Collapse)AuthorAgeFilesLines
* Support for Toshiba MeP and for complex relocations.Dave Brolley2007-02-051-0/+4
|
* * elf-bfd.h (struct elf_obj_tdata): Change symbuf type to void *.Jakub Jelinek2007-02-021-99/+211
| | | | | | | | | | | | * elf.c (struct elf_symbuf_symbol, struct elf_symbuf_head): New types. (struct elf_symbol): Change first member into union. (elf_sort_elf_symbol): Compare pointers to internal syms rather than internal syms. Only compare st_shndx fields. (elf_create_symbuf): New function. (bfd_elf_match_symbols_in_sections): Use it. If symbufs are available for bfds, use a binary search, otherwise don't qsort symbols unnecessarily only to select which symbols are for the particular shndx.
* PR ld/3852Nick Clifton2007-02-011-16/+1
| | | | | * elf.c (_bfd_elf_link_hash_table_init): Initialize all the fields in the elf_link_hash_table structure.
* * elf-bfd.h (struct elf_backend_data): Add elf_backend_write_core_note.Alan Modra2007-02-011-28/+103
| | | | | | | | | | | | | | | * elfxx-target.h (elf_backend_write_core_note): Define and use. * elf.c (elfcore_write_prpsinfo): Call the above. Add support for 32-bit core note on 64-bit target. (elfcore_write_prstatus): Likewise. (elfcore_write_lwpstatus): Make note_name const. (elfcore_write_prfpreg): Likewise. (elfcore_write_pstatus): Add support for 32-bit core note on 64-bit target. * elf32-ppc.c (ppc_elf_write_core_note): New function. (elf_backend_write_core_note): Define. * elf64-ppc.c (ppc64_elf_write_core_note): New function. (elf_backend_write_core_note): Define.
* 2007-01-30 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu2007-01-301-6/+11
| | | | | | * elf.c (copy_elf_program_header): Start from the first section in a segment and stop when all sections in a segment are accounted for.
* bfd/Nathan Sidwell2007-01-111-1/+1
| | | | | | | | | | | | * elf.c (assign_file_positions_for_load_sections): We can require fewer phdrs than expected. ld/ * emultempl/elf-generic.em (gdl_map_segments): Only allow header shrinkage for the first few iterations. ld/testsuite/ * ld-elf/header.d: New. * ld-elf/header.t: New. * ld-elf/header.s: New.
* bfd/Nathan Sidwell2006-12-191-13/+37
| | | | | | | | | | | * elf.c (assign_file_positions_for_load_sections): Adjust p_vaddr by p_vaddr_offset. Copy alignment & use if it is valid. (rewrite_elf_program_headers): Cope with leading padding in a segment that does not contain file or program headers. (copy_elf_program_header): Likewise. include/elf/ * internal.h (struct elf_segment_map): Add p_vaddr_offset field.
* 2006-12-01 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu2006-12-011-1/+1
| | | | | | | PR binutils/3609 * elf.c (rewrite_elf_program_header): Preserve segment physical address in the output segment if the first section in the corresponding input segment is null.
* PR 3609Nick Clifton2006-12-011-1/+2
| | | | * elf.c (rewrite_elf_program_header): Do not use the first_section pointer if it is null.
* 2006-11-24 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu2006-11-251-6/+29
| | | | | | | | * elf.c (IS_SECTION_IN_INPUT_SEGMENT): New. (INCLUDE_SECTION_IN_SEGMENT): Use IS_SECTION_IN_INPUT_SEGMENT. (rewrite_elf_program_header): Don't preserve segment physical address in the output segment if the first section in the corresponding input segment is removed.
* * elf.c (elfcore_write_note): Pad note descriptor to 4-byteAlan Modra2006-10-311-22/+25
| | | | boundary. Tidy. Comment.
* bfd/H.J. Lu2006-10-301-19/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2006-10-30 H.J. Lu <hongjiu.lu@intel.com> PR ld/3111 * elf-bfd.h (elf_obj_tdata): Add symbuf. (_bfd_elf_section_already_linked): Add struct bfd_link_info *. (_bfd_elf_check_kept_section): Likewise. (bfd_elf_match_symbols_in_sections): Likewise. * elf.c (assign_section_numbers): Updated to add struct bfd_link_info *. (bfd_elf_match_symbols_in_sections): Updated. Cache symbol buffer if info->reduce_memory_overheads is false. * elflink.c (match_group_member): Updated to add struct bfd_link_info *. (_bfd_elf_check_kept_section): Likewise. (elf_link_input_bfd): Likewise. (_bfd_elf_section_already_linked): Likewise. (bfd_elf_final_link): Free symbol buffer if info->reduce_memory_overheads is false. * libbfd-in.h (_bfd_nolink_section_already_linked): Add struct bfd_link_info *. (_bfd_generic_section_already_linked): Likewise. * libbfd.h: Regenerated. * linker.c (bfd_section_already_linked): Add struct bfd_link_info *. (_bfd_generic_section_already_linked): Likewise. * targets.c (bfd_target): Add struct bfd_link_info * to _section_already_linked. * bfd-in2.h: Regenerated. include/ 2006-10-30 H.J. Lu <hongjiu.lu@intel.com> PR ld/3111 * bfdlink.h (bfd_link_info): Add reduce_memory_overheads. ld/ 2006-10-30 H.J. Lu <hongjiu.lu@intel.com> PR ld/3111 * ld.h (args_type): Remove reduce_memory_overheads. * ldlang.c (lang_map): Updated. (section_already_linked): Likewise. (print_input_section): Likewise. * ldmain.c (main): Likewise. * lexsup.c (parse_args): Likewise.
* * elf.c (elfcore_write_note): Pad to 4-byte boundary.Alan Modra2006-10-291-1/+1
|
* 2006-10-26 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu2006-10-271-3/+11
| | | | | | * elf.c (_bfd_elf_init_private_section_data): Assert output section ELF type instead of check if it is SHT_NULL. Copy OS/PROC specific flags from input section to output section.
* * elf.c (bfd_section_from_shdr): Remove extraneous breaks.Ben Elliston2006-10-261-2/+0
| | | | * targets.c (find_target): Remove extraneous break.
* * elf.c (bfd_elf_set_dyn_lib_class): Change second argument typeBen Elliston2006-10-261-1/+1
| | | | | | from int to enum dynamic_lib_link_class lib_class. * bfd-in.h (bfd_elf_set_dyn_lib_class): Likewise. * bfd-in2.h: Regenerate.
* 2006-10-15 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu2006-10-151-5/+6
| | | | | | PR ld/3314 * elf.c (assign_file_positions_for_non_load_sections): Don't page align empty SHF_ALLOC sections.
* bfd/H.J. Lu2006-09-271-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2006-09-26 H.J. Lu <hongjiu.lu@intel.com> PR ld/3223 PR ld/3267 * elf.c (assign_file_positions_for_non_load_sections): Don't warn zero size allocated sections. ld/ 2006-09-26 H.J. Lu <hongjiu.lu@intel.com> PR ld/3223 PR ld/3267 * ld.texinfo: Updated Output Section Discarding. * ldlang.h (lang_output_section_statement_type): Add section_relative_symbol. * ldlang.c (strip_excluded_output_sections): Don't strip a section with a symbol relative to it. (lang_size_sections_1): Mark if an output section has a symbol symbol relative to it. ld/testsuite/ 2006-09-26 H.J. Lu <hongjiu.lu@intel.com> PR ld/3223 PR ld/3267 * ld-scripts/empty-address-1.d: New file. * ld-scripts/empty-address-1.s: Likewise. * ld-scripts/empty-address-1.t: Likewise. * ld-scripts/empty-address-2.s: Likewise. * ld-scripts/empty-address-2a.d: Likewise. * ld-scripts/empty-address-2a.t: Likewise. * ld-scripts/empty-address-2b.d: Likewise. * ld-scripts/empty-address-2b.t: Likewise. * ld-scripts/empty-address-3.s: Likewise. * ld-scripts/empty-address-3a.d: Likewise. * ld-scripts/empty-address-3a.t: Likewise. * ld-scripts/empty-address-3b.d: Likewise. * ld-scripts/empty-address-3b.t: Likewise. * ld-scripts/empty-address-3c.d: Likewise. * ld-scripts/empty-address-3c.t: Likewise. * ld-scripts/empty-address.exp: Likewise.
* 2006-09-26 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu2006-09-261-2/+2
| | | | | | | PR binutils/3262 * elf.c (rewrite_elf_program_header): Use bfd_zalloc instead of bfd_alloc to allocate segment map. (copy_elf_program_header): Likewise.
* * elfcode.h (elf_swap_symbol_in): Return bfd_boolean. Don't abortAlan Modra2006-09-221-1/+9
| | | | | | | | | on error. * elf-bfd.h (elf_size_info <swap_symbol_in>): Adjust decl. (bfd_elf32_swap_symbol_in, bfd_elf64_swap_symbol_in): Likewise. * elf.c (bfd_elf_get_elf_syms): Test return of swap_symbol_in, and report error. * elf32-arm.c (elf32_arm_swap_symbol_in): Return bfd_boolean.
* * elf.c (special_sections_s): Revert last STRING_COMMA_LEN changeHans-Peter Nilsson2006-09-171-1/+3
| | | | for .stabstr entry, explain why.
* * bfd-in.h (STRING_AND_COMMA): New macro. Takes one constant string as itsNick Clifton2006-09-161-69/+67
| | | | | | | | | | | argument and emits the string followed by a comma and then the length of the string. (CONST_STRNEQ): New macro. Checks to see if a variable string has a constant string as its initial characters. (CONST_STRNCPY): New macro. Copies a constant string to the start of a variable string. * bfd-in2.h: Regenerate. * <remainign files>: Make use of the new macros.
* PR 3182Alan Modra2006-09-141-0/+23
| | | | | | | | | * elf.c (_bfd_elf_copy_private_header_data): Fix group members that have had their SHT_GROUP section removed. * objcopy.c (group_signature): New function, split out from.. (setup_section): ..here. (is_strip_section): Return true for SHT_GROUP sections that are going to lose their group signature symbol.
* 2006-09-10 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu2006-09-101-1/+1
| | | | | | PR binutils/3186 * elf.c (_bfd_elf_make_section_from_shdr): Correct length of "gnu.linkonce.wi.".
* bfd/H.J. Lu2006-08-171-10/+15
| | | | | | | | | | | | | | | | | | 2006-08-16 H.J. Lu <hongjiu.lu@intel.com> PR ld/3015 * elf.c (get_program_header_size): Add a PT_GNU_RELRO segment only if there is a PT_DYNAMIC segment. (_bfd_elf_map_sections_to_segments): Likewise. (assign_file_positions_for_load_sections): Set PT_GNU_RELRO segment alignment to 1. ld/testsuite/ 2006-08-16 H.J. Lu <hongjiu.lu@intel.com> PR ld/3015 * ld-elf/binutils.exp: Add tests for "-z relro".
* * elf.c (elf_modify_segment_map): Delete empty PT_LOAD segments.Alan Modra2006-07-261-20/+23
| | | | | * elf32-xtensa.c (elf_xtensa_modify_segment_map): Delete. (define elf_backend_modify_segment_map): Don't define.
* * emulparams/elf_x86_64.sh (LIBPATH_SUFFIX, ELF_INTERPRETER_NAME): Set for ↵Nick Clifton2006-07-241-5/+14
| | | | | | | *-*-solaris2*. * elf.c (bfd_section_from_shdr): Reject unrecognised OS-specific sections only if the SHF_OS_NONCONFORMING flag is present.
* include/Jakub Jelinek2006-07-101-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bfdlink.h (struct bfd_link_info): Add emit_hash and emit_gnu_hash bitfields. include/elf/ * common.h (SHT_GNU_HASH, DT_GNU_HASH): Define. ld/ * scripttempl/elf.sc: Add .gnu.hash section. * emultempl/elf32.em (OPTION_HASH_STYLE): Define. (gld${EMULATION_NAME}_add_options): Register --hash-style option. (gld${EMULATION_NAME}_handle_option): Handle it. (gld${EMULATION_NAME}_list_options): Document it. * ldmain.c (main): Initialize emit_hash and emit_gnu_hash. * ld.texinfo: Document --hash-style option. bfd/ * elf.c (_bfd_elf_print_private_bfd_data): Handle DT_GNU_HASH. (bfd_section_from_shdr, elf_fake_sections, assign_section_numbers): Handle SHT_GNU_HASH. (special_sections_g): Include .gnu.hash section. (bfd_elf_gnu_hash): New function. * elf-bfd.h (bfd_elf_gnu_hash, _bfd_elf_hash_symbol): New prototypes. (struct elf_backend_data): Add elf_hash_symbol method. * elflink.c (_bfd_elf_link_create_dynamic_sections): Create .hash only if info->emit_hash, create .gnu.hash section if info->emit_gnu_hash. (struct collect_gnu_hash_codes): New type. (elf_collect_gnu_hash_codes, elf_renumber_gnu_hash_syms, _bfd_elf_hash_symbol): New functions. (compute_bucket_count): Don't compute HASHCODES array, instead add that and NSYMS as arguments. Use bed->s->sizeof_hash_entry instead of bed->s->arch_size / 8. Fix .hash size estimation. When not optimizing, use the number of hashed symbols rather than dynsymcount. (bfd_elf_size_dynamic_sections): Only add DT_HASH if info->emit_hash, and ADD DT_GNU_HASH if info->emit_gnu_hash. (bfd_elf_size_dynsym_hash_dynstr): Size .hash only if info->emit_hash, adjust compute_bucket_count caller. Create and populate .gnu.hash section if info->emit_gnu_hash. (elf_link_output_extsym): Only populate .hash section if finfo->hash_sec != NULL. (bfd_elf_final_link): Adjust assertion. Handle DT_GNU_HASH. * elfxx-target.h (elf_backend_hash_symbol): Define if not yet defined. (elfNN_bed): Add elf_backend_hash_symbol. * elf64-x86-64.c (elf64_x86_64_hash_symbol): New function. (elf_backend_hash_symbol): Define. * elf32-i386.c (elf_i386_hash_symbol): New function. (elf_backend_hash_symbol): Define. binutils/ * readelf.c (get_dynamic_type): Handle DT_GNU_HASH. (get_section_type_name): Handle SHT_GNU_HASH. (dynamic_info_DT_GNU_HASH): New variable. (process_dynamic_section): Handle DT_GNU_HASH. (process_symbol_table): Print also DT_GNU_HASH histogram. ld/testsuite/ * ld-powerpc/tlsso32.r: Adjust. * ld-powerpc/tlsso32.d: Adjust. * ld-powerpc/tlsso32.g: Adjust. * ld-powerpc/tlsso.r: Adjust. * ld-powerpc/tlsso.g: Adjust. * ld-powerpc/tlstocso.g: Adjust.
* PR ld/2754Alan Modra2006-06-231-15/+21
| | | | | | | | | | | | | | | | | | | | * elf.c (bfd_elf_mkobject): Don't alloc if already done. Set program_header_size to -1. (_bfd_elf_map_sections_to_segments): Adjust program_header_size check. (assign_file_positions_for_load_sections ): Likewise. (_bfd_elf_sizeof_headers): Use saved program_header_size if available. * elf32-arm.c (elf32_arm_mkobject): Call bfd_elf_mkobject, don't alloc if already done. * elf32-i386.c (elf_i386_mkobject): Likewise. * elf32-ppc.c (ppc_elf_mkobject): Likewise. * elf32-s390.c (elf_s390_mkobject): Likewise. * elf32-sh.c (sh_elf_mkobject): Likewise. * elf64-alpha.c (elf64_alpha_mkobject): Likewise. * elf64-ppc.c (ppc64_elf_mkobject): Likewise. * elf64-s390.c (elf_s390_mkobject): Likewise. * elf64-x86-64.c (elf64_x86_64_mkobject): Likewise. * elfxx-sparc.c (_bfd_sparc_elf_mkobject): Likewise.
* * elf-bfd.h (struct elf_backend_data): AddAlan Modra2006-06-201-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | elf_backend_modify_program_headers. * elfxx-target.h (elf_backend_modify_program_headers): Define. (elfNN_bed): Init new field. * elf.c (elf_modify_segment_map): Remove comment. (assign_file_positions_for_load_sections): Only call elf_modify_segment_map for objcopy/strip. (assign_file_positions_except_relocs): Call elf_backend_modify_program_headers. * elf32-frv.c (elf32_frvfdpic_always_size_sections): Don't make .stack section. (elf32_frvfdpic_modify_segment_map): Delete. (elf32_frvfdpic_modify_program_headers): New. (elf_backend_modify_segment_map): Don't define. (elf_backend_modify_program_headers): Define. * elf32-bfin.c (elf32_bfinfdpic_always_size_sections): Don't make .stack section. (elf32_bfinfdpic_modify_segment_map): Delete. (elf32_bfinfdpic_modify_program_headers): New. (elf_backend_modify_segment_map): Don't define. (elf_backend_modify_program_headers): Define. * elfxx-ia64.c (elfNN_ia64_modify_program_headers): New function. Split out from.. (elfNN_ia64_modify_segment_map): ..here. (elf_backend_modify_program_headers): Define.
* * bfd.c (bfd_record_phdr): Clear p_align and p_align_valid fields.Jakub Jelinek2006-06-201-0/+1
| | | | * elf.c (_bfd_elf_link_hash_table_init): Clear hplt field.
* bfd/Alan Modra2006-06-201-503/+450
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * elf-bfd.h: Formatting. (_bfd_elf_map_sections_to_segments): Declare. * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame_hdr): Don't clear program_header_size. * elf.c (get_program_header_size): Move. Don't use or set saved program_header_size here. (elf_modify_segment_map): New function. Split out from.. (assign_file_positions_for_load_sections): ..here. Assert header size is correct. Remove dead code. (_bfd_elf_map_sections_to_segments): Rename from map_sections_to_segments. Make global. Use get_program_header_size when we need estimate of header size. Call elf_modify_segment_map. Set program_header_size. (print_segment_map): Delete. (_bfd_elf_sizeof_headers): If segment_map available, get the actual size. * elf32-arm.c (elf32_arm_symbian_modify_segment_map): Make safe for calling more than once. * elf32-bfin.c (elf32_bfinfdpic_modify_segment_map): Likewise. * elf32-frv.c (elf32_frvfdpic_modify_segment_map): Likewise. * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Likewise. * elf32-i370.c (elf_backend_add_symbol_hook): Delete. (elf_backend_additional_program_headers): Delete. (elf_backend_modify_segment_map): Delete. * elf64-hppa.c (elf64_hppa_modify_segment_map): Convert to ISO C. * elfxx-ia64.c (elfNN_ia64_modify_segment_map): Likewise. * doc/bfdint.texi: Delete SIZEOF_HEADERS difficulties. ld/ * Makefile.am (ELF_DEPS): Define. Use in emul file deps. Fix many ELF emul file deps that incorrectly said they needed elf32.em instead of generic.em. Add genelf.em as required. * Makefile.in: Regenerate. * ldlang.c (lang_process): Call ldemul_finish before lang_check_section_addresses. * emulparams/arcelf.sh: Generic elf target needs genelf. * emulparams/d30v_e.sh: Likewise. * emulparams/d30v_o.sh: Likewise. * emulparams/d30velf.sh: Likewise. * emulparams/elf32_dlx.sh: Likewise. * emulparams/elf32_i860.sh: Likewise. * emulparams/elf32fr30.sh: Likewise. * emulparams/elf32frv.sh: Likewise. * emulparams/elf32iq10.sh: Likewise. * emulparams/elf32iq2000.sh: Likewise. * emulparams/elf32mt.sh: Likewise. * emulparams/mn10200.sh: Likewise. * emulparams/or32.sh: Likewise. * emulparams/or32elf.sh: Likewise. * emulparams/pjelf.sh: Likewise. * emulparams/msp430all.sh: Likewise. Extract common entries. * emulparams/pjlelf.sh: Include pjelf.sh. * emulparams/elf32frvfd.sh (EXTRA_EM_FILE): Unset. * emulparams/mn10300.sh (EXTRA_EM_FILE): Unset. * emultempl/elf-generic.em: New file. * emultempl/genelf.em: New file. * emultempl/elf32.em: Include elf-generic.em. (gld${EMULATION_NAME}_layout_sections_again): Delete. (gld${EMULATION_NAME}_finish): Call gld${EMULATION_NAME}_map_segments. * emultempl/hppaelf.em (hppaelf_layout_sections_again): Likewise. (gld${EMULATION_NAME}_finish): Rename from hppaelf_finish. Call gld${EMULATION_NAME}_map_segments. (LDEMUL_FINISH): Update. * emultempl/mmo.em: Correct comment. Include elf-bfd.h and source elf-generic.em. (mmo_finish): Call gld${EMULATION_NAME}_map_segments. * emultempl/ppc64elf.em (ppc_layout_sections_again): Likewise. (gld${EMULATION_NAME}_finish): Rename from ppc_finish. Call gld${EMULATION_NAME}_map_segments. (LDEMUL_FINISH): Update. ld/testsuite/ * ld-elf/eh1.d: Update for fewer program headers. * ld-elf/eh2.d: Likewise. * ld-elf/eh3.d: Likewise.
* bfd/Alan Modra2006-06-191-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * elf-bfd.h (struct elf_backend_data): Add bfd_link_info pointer parameter. (_bfd_elf_sizeof_headers): Replace bfd_boolean param with bfd_link_info pointer. * targets.c (struct bfd_target <_bfd_sizeof_headers>): Likewise. * bfd.c (bfd_sizeof_headers): Tweak param name. * aout-adobe.c (aout_adobe_sizeof_headers): Adjust. * aoutx.h (NAME (aout, sizeof_headers)): Adjust. * binary.c (binary_sizeof_headers): Adjust. * bout.c (b_out_sizeof_headers): Adjust. * coff-rs6000.c (_bfd_xcoff_sizeof_headers): Adjust. * coff64-rs6000.c (xcoff64_sizeof_headers): Adjust. * coffgen.c (coff_sizeof_headers): Adjust. * ecoff.c (_bfd_ecoff_sizeof_headers): Adjust. (ecoff_compute_section_file_positions): Adjust. (_bfd_ecoff_write_object_contents): Adjust. * elf.c (get_program_header_size, _bfd_elf_sizeof_headers): Adjust. * elf32-arm.c (elf32_arm_additional_program_headers): Adjust. * elf32-i370.c (elf_backend_additional_program_headers): Adjust. * elf32-ppc.c (ppc_elf_additional_program_headers): Adjust. * elf64-hppa.c (elf64_hppa_additional_program_headers): Adjust. * elf64-x86-64.c (elf64_x86_64_additional_program_headers): Adjust. * elfxx-ia64.c (elfNN_ia64_additional_program_headers): Adjust. * elfxx-mips.c (_bfd_mips_elf_additional_program_headers): Adjust. * elfxx-mips.h (_bfd_mips_elf_additional_program_headers): Adjust. * i386msdos.c: Convert to ISO C. (msdos_sizeof_headers): Adjust. * i386os9k.c: Convert to ISO C. (os9k_sizeof_headers): Adjust. * ieee.c (ieee_sizeof_headers): Adjust. * ihex.c (ihex_sizeof_headers): Adjust. * libaout.h (NAME (aout, sizeof_headers)): Adjust. * libbfd-in.h (_bfd_nolink_sizeof_headers): Adjust. * libcoff-in.h (coff_sizeof_headers): Adjust. * libecoff.h (_bfd_ecoff_sizeof_headers): Adjust. * mach-o.c (bfd_mach_o_sizeof_headers): Adjust. * mmo.c (mmo_sizeof_headers): Adjust. * oasys.c (oasys_sizeof_headers): Adjust. * pdp11.c (NAME (aout, sizeof_headers)): Adjust. * pef.c (bfd_pef_sizeof_headers): Adjust. * ppcboot.c (ppcboot_sizeof_headers): Adjust. * som.c (som_sizeof_headers): Adjust. * srec.c (srec_sizeof_headers): Adjust. * tekhex.c (tekhex_sizeof_headers): Adjust. * versados.c (versados_sizeof_headers): Adjust. * vms.c (vms_sizeof_headers): Adjust. * xcoff-target.h (_bfd_xcoff_sizeof_headers): Adjust. * xsym.c (bfd_sym_sizeof_headers): Adjust. * xsym.h (bfd_sym_sizeof_headers): Adjust. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * libcoff.h: Regenerate. ld/ * ldexp.c (fold_name): Adjust bfd_sizeof_headers call.
* * elf.c (_bfd_elf_init_private_section_data): Comment typo.Alan Modra2006-06-061-7/+6
| | | | | (elfcore_grok_nto_status): Use long instead of pid_t. (elfcore_grok_nto_regs, elfcore_grok_nto_note): Likewise.
* * stabs.c (_bfd_link_section_stabs): Use bfd_make_section*_with_flagsAlan Modra2006-06-011-18/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* bfd/Alan Modra2006-05-271-27/+46
| | | | | | | | | * elf.c (assign_file_positions_for_load_sections): Retrieve maxpagesize from m->p_align if it is valid. Set p_vaddr, p_paddr and p_align earlier. Revert 2006-05-19 change to p_align. (copy_elf_program_header): Copy p_align. Set p_align_valid. include/elf/ * internal.h (elf_segment_map): Add p_align and p_align_valid.
* * elf.c (sym_is_global): Return a bfd_boolean.Alan Modra2006-05-251-36/+31
| | | | | | | (ignore_section_sym): New function. (elf_map_symbols): Use ignore_section_sym to discard some syms. (_bfd_elf_symbol_from_bfd_symbol): Ensure section belongs to bfd before using elf_section_syms.
* * elf.c (elf_fake_sections): Formatting.Alan Modra2006-05-191-29/+30
| | | | | | | | | (assign_file_positions_for_load_sections): Only add SEC_ALLOC sections to p_memsz. Remove hack for PT_NOTE sections. Allow section alignment to increase p_align for PT_LOAD. (assign_file_positions_for_non_load_sections): Remove ARM BPABI hack for PT_DYNAMIC. Instead, set p_filesz for all segments other than PT_LOAD, and PT_NOTE in core.
* * elf.c (assign_file_positions_for_segments): Split into..Alan Modra2006-05-171-54/+87
| | | | | | (assign_file_positions_for_load_sections): ..this, and.. (assign_file_positions_for_non_load_sections): ..this new function,.. (assign_file_positions_except_relocs): ..writing program headers here.
* * elf.c (_bfd_elf_init_private_section_data): Don't changeAlan Modra2006-05-111-1/+2
| | | | section type if already set.
* bfd/Alan Modra2006-05-031-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libbfd-in.h (_bfd_generic_new_section_hook): Declare. * section.c (bfd_abs_symbol, bfd_com_symbol): Delete. (bfd_und_symbol, bfd_ind_symbol): Delete. (BFD_FAKE_SECTION): Remove SYM_PTR param, set symbol_ptr_ptr to &SEC.symbol. (STD_SECTION): Adjust. (_bfd_generic_new_section_hook): New function, extracted from.. (bfd_section_init): ..here. (bfd_make_section_old_way): Call new_section_hook for abs, com, und and ind sections. * elf.c (_bfd_elf_large_com_section): Adjust. * aoutx.h (new_section_hook): Call _bfd_generic_new_section_hook. * pdp11.c (new_section_hook): Likewise. * coffcode.h (coff_new_section_hook): Likewise. * ecoff.c (_bfd_ecoff_new_section_hook): Likewise. * elf.c (_bfd_elf_new_section_hook): Likewise. * vms.c (vms_new_section_hook): Likwise. * elf32-arm.c (elf32_arm_new_section_hook): Check used_by_bfd isn't already set. * elf32-sh64.c (sh64_elf_new_section_hook): Likewise. * elf32-xtensa.c (elf_xtensa_new_section_hook): Likewise. * elf64-mmix.c (mmix_elf_new_section_hook): Likewise. * elf64-ppc.c (ppc64_elf_new_section_hook): Likewise. * elfxx-mips.c (_bfd_mips_elf_new_section_hook): Likewise. * elfxx-sparc.c (_bfd_sparc_elf_new_section_hook): Likewise. * ieee.c (ieee_new_section_hook): Likewise. Call _bfd_generic_new_section_hook too. * mmo.c (mmo_new_section_hook): Likewise. * oasys.c (oasys_new_section_hook): Likewise. * som.c (som_new_section_hook): Likewise. * coff-w65.c (reloc_processing): Don't use bfd_abs_symbol. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. gas/ * subsegs.c (subseg_get): Don't call obj_sec_set_private_data. * config/obj-elf.h (obj_sec_set_private_data): Delete. * config/tc-hppa.c (tc_gen_reloc): Don't use bfd_abs_symbol. * config/tc-mn10300.c (tc_gen_reloc): Likewise.
* * archive.c (bfd_generic_archive_p): Remove unused local variableBen Elliston2006-05-021-2/+0
| | | | | | | | | | | | | | | | `fail'. * dwarf2.c (decode_line_info): Remove unused local variable `basic_block'. * elfcode.h (elf_slurp_reloc_table_from_section): Remove unsed local varibale `s'. * tekhex.c (tekhex_write_object_contents): Remove unused local variable `bytes_written'. * aout-ns32k.c (MY_swap_std_reloc_out): Remove unused local variable `r_addend'. * elf32-dlx.c (dlx_rtype_to_howto): Remove breaks after returns. * elfxx-mips.c (_bfd_elf_mips_mach): Remove breaks after returns. (_bfd_ns32k_relocate_contents): Remove break after return. * elf.c (bfd_section_from_shdr): Remove breaks after returns.
* 2006-04-26 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu2006-04-261-7/+12
| | | | | | | | | PR binutils/2593 * elf.c (_bfd_elf_new_section_hook): Don't set section ELF type and flags if its BFD flags have been set. (_bfd_elf_init_private_section_data): Don't copy the output ELF section type from input if it has been set to something different.
* 2006-04-25 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu2006-04-251-1/+1
| | | | | | | | | | | | | | | | | | | | 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.
* * elf.c (assign_file_positions_except_relocs): Move code settingAlan Modra2006-04-211-54/+55
| | | | | file position of non-loaded sections.. (assign_file_positions_for_segments): ..to here.
* 2006-04-20 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu2006-04-211-2/+37
| | | | | | | PR ld/2537 * elf.c (bfd_section_from_shdr): Allow sections reserved for applications. Issue an error on sections we don't know how to handle.
* PR 2434Alan Modra2006-03-161-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* 2006-02-16 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu2006-02-161-14/+63
| | | | | | | | | PR ld/2322 * elf.c (get_segment_type): New function. (_bfd_elf_print_private_bfd_data): Use it. (print_segment_map): New function. (assign_file_positions_for_segments): Call print_segment_map when there are not enough room for program headers.
* 2006-02-10 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu2006-02-101-2/+1
| | | | * elf.c (copy_private_bfd_data): Minor update.
* bfd/H.J. Lu2006-02-101-9/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | 2006-02-10 H.J. Lu <hongjiu.lu@intel.com> PR binutils/2258 * elf.c (copy_private_bfd_data): Renamed to ... (rewrite_elf_program_header): This. (copy_elf_program_header): New function. (copy_private_bfd_data): Likewise. binutils/ 2006-02-10 H.J. Lu <hongjiu.lu@intel.com> PR binutils/2258 * readelf.c (process_program_headers): Use ELF_IS_SECTION_IN_SEGMENT_MEMORY. include/elf/ 2006-02-10 H.J. Lu <hongjiu.lu@intel.com> PR binutils/2258 * internal.h (ELF_IS_SECTION_IN_SEGMENT_FILE): New. (ELF_IS_SECTION_IN_SEGMENT_MEMORY): Likewise.