aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf.c
AgeCommit message (Collapse)AuthorFilesLines
1997-03-10 From Eric Youngdale <eric@andante.jic.com>:Ian Lance Taylor1-10/+100
* elf-bfd.h (elf_symbol_type): Add version field. * elfcode.h (elf_slurp_symbol_table): Set version field. * elflink.h (elf_link_add_object_symbols): When creating an indirect symbol for a default version symbol, set DEF_DYNAMIC if appropriate. Set up an indirection from the nondefault version of the symbol as well. (NAME(bfd_elf,size_dynamic_sections)): Call elf_link_assign_sym_version before checking whether there are any versions. Always record the version name as a dynamic symbol. Initialize counters. (elf_link_assign_sym_version): After finding a version, see if a symbol should be forced to local scope. Create a new version definition if appropriate. (elf_link_output_extsym): Correct indirect symbol handling. * elf.c (bfd_elf_print_symbol): Print version information. (bfd_section_from_shdr): Turn version sections into BFD sections. (elf_fake_sections): Only copy cverdefs and cverrefs into sh_info if sh_info is not already set. (_bfd_elf_copy_private_section_data): Copy sh_info for version sections. * elflink.c (_bfd_elf_link_record_dynamic_symbol): Tell _bfd_stringtab_add to copy the name into permanent memory if appropriate.
1997-02-28 * elfxx-target.h (bfd_elfNN_bfd_is_local_label_name): Define asIan Lance Taylor1-3/+460
_bfd_elf_is_local_label_name if not already defined. * elf.c (_bfd_elf_is_local_label_name): New function. * elf-bfd.h (_bfd_elf_is_local_label_name): Declare.
1997-02-20Since d10v is public now, remove all sanitization statementsMichael Meissner1-2/+0
1997-02-19Tue Feb 18 17:22:59 1997 Martin M. Hunt <hunt@pizza.cygnus.com>Martin Hunt1-1/+6
* Makefile.in, archures.c, config.bfd, configure.in, elf.c, reloc.c, targets.c: New target, elf-*-D30V. * bfd-in2.h, configure, libbfd.h: Rebuilt. * cpu-d30v.c, elf32-d30v.c: New files.
1997-01-03Fri Jan 3 16:58:31 1997 Richard Henderson <rth@tamu.edu>Ian Lance Taylor1-1/+1
elf64-alpha multiple .got rewrite: * elf-bfd.h (struct elf_backend_data): Add always_size_sections entry. (bfd_elf*_mkobject): Don't define here ... * elfxx-target.h: ... but rather here. Default always_size_sections hook to NULL. * elf.c (elf_mkobject): Rename to bfd_elf_mkobject, since that was what the #defines in elf-bfd.h transmuted it to anyway. * section.c: Add SEC_LINKER_CREATED flag. * bfd-in2.h: Rebuild. * elf32-i386.c (elf_i386_check_relocs): Add SEC_LINKER_CREATED to relocation section flags. (elf_i386_size_dynamic_sections): Use SEC_LINKER_CREATED instead of SEC_IN_MEMORY to recognize generated bits. * elf32-m68k.c (elf_m68k_check_relocs, elf_m68k_size_dynamic_sections): Likewise. * elf32-mips.c (mips_elf_final_link, mips_elf_create_dynamic_sections, mips_elf_create_compact_rel_section, mips_elf_create_got_section, mips_elf_check_relocs, mips_elf_size_dynamic_sections): Likewise. * elf32-ppc.c (ppc_elf_create_linker_section, ppc_elf_size_dynamic_sections): Likewise. * elf32-sparc.c (elf32_sparc_check_relocs, elf32_sparc_size_dynamic_sections): Likewise. * elflink.c (_bfd_elf_create_got_section): Add SEC_LINKER_CREATED to section flags. (_bfd_elf_create_dynamic_sections): Likewise. (_bfd_elf_make_linker_section_rela): Likewise. * elflink.h (elf_link_create_dynamic_sections): Likewise. (bfd_elf,size_dynamic_sections): Call the always_size_sections hook. (elf_bfd_final_link): Use SEC_LINKER_CREATED instead of SEC_IN_MEMORY to identify generated bits. (elf_link_input_bfd): Likewise. * elf64-alpha.c: Rewrite everything touching relocations.
1996-12-31 * elflink.h (NAME(bfd_elf,size_dynamic_sections)): AddIan Lance Taylor1-0/+2
filter_shlib and auxiliary_filter_shlib parameters. * elf.c (_bfd_elf_print_private_bfd_data): Handle DT_AUXILIARY and DT_FILTER. * bfd-in.h (bfd_elf32_size_dynamic_sections): Update declaration. (bfd_elf64_size_dynamic_sections): Likewise. * bfd-in2.h: Rebuild.
1996-12-17 * elf.c (bfd_elf_print_symbol): Print the st_other field if it isIan Lance Taylor1-0/+5
not zero.
1996-12-16 * elf.c (bfd_section_from_shdr): Don't check for reloc sectionsIan Lance Taylor1-14/+1
against SEC_DEBUGGING sections here (revert patch of December 5). * elfcode.h (elf_object_p): Check for them here, instead.
1996-12-15 * elfcode.h (elf_slurp_reloc_table): Add dynamic parameter.Ian Lance Taylor1-1/+85
* elf.c (_bfd_elf_canonicalize_reloc): Pass new argument to slurp_reloc_table. (_bfd_elf_get_dynamic_reloc_upper_bound): New function. (_bfd_elf_canonicalize_dynamic_reloc): New function. * elf-bfd.h (struct elf_size_info): Update declaration of slurp_reloc_table. (_bfd_elf_get_dynamic_reloc_upper_bound): Declare. (_bfd_elf_canonicalize_dynamic_reloc): Declare. * elfxx-target.h: Use new dynamic reloc routines by default. * elf64-mips.c (mips_elf64_slurp_reloc_table): Add dynamic parameter.
1996-12-05 * elflink.h (elf_link_add_object_symbols): Calling check_relocsIan Lance Taylor1-4/+24
even if SEC_ALLOC is not set. * elf32-i386.c (elf_i386_check_relocs): Don't check SEC_ALLOC when deciding whether to copy a reloc into a shared object. (elf_i386_relocate_section): Likewise. * elf32-sparc.c (elf32_sparc_check_relocs): Likewise. (elf32_sparc_relocate_section): Likewise. * elf32-i386.c (elf_i386_check_relocs): Don't set SEC_ALLOC in a reloc section if it is not set in the source section. * elf32-sparc.c (elf32_sparc_check_relocs): Likewise. * elf.c (bfd_section_from_shdr): Mark a reloc section associated with a SEC_DEBUGGING section as SEC_DEBUGGING. PR 11174.
1996-10-03 * cpu-mn10x00.c, elf32-mn10x00.c: New files.Jeff Law1-0/+7
* Makefile.in (ALL_MACHINES): Add cpu-mn10x00.o. (BFD32_BACKENDS): Similarly for elf32-mn10x00.o. (elf32-mn10x00.o): Add dependencies. * archures.c (enum bfd_architecture): Add bfd_arch_mn10x00. (bfd_mn10x00_arch): Declare. (bfd_archures_list): Add bfd_mn10x00_arch. * config.bfd: Add mn10x00-*-*. * configure.in: Add bfd_elf32_mn10x00_vec. * elf.c (prep_headers): Handle bfd_arch_mn10x00. * targets.c (bfd_elf32_mn10x00_vec): Declare. (bfd_target_vector): Add bfd_elf32_mn10x00_vec. * bfd-in2.h, configure: Rebuilt. Stubbing out Matsushita support.
1996-09-11 * elf.c (assign_file_positions_for_segments): Test SEC_ALLOCIan Lance Taylor1-1/+1
rather than SEC_LOAD when aligning the file offset for the first section in a segment. Fixes the case in which . is set just before the .bss section in a linker script.
1996-09-11 * syms.c (coff_section_type): Make arg const.Fred Fish1-0/+6
* irix-core.c (irix_core_core_file_p): Remove extraneous extra arg to make_bfd_asection(). * elf-bfd.h (bfd_section_from_phdr): Add prototype. * elfcode.h (bfd_section_from_phdr): Remove prototype. (_bfd_elf_stringtab_init): Remove prototype. * netbsd-core.c (swap_abort): Add prototype. * aix386-core.c (swap_abort): Ditto & make static * hpux-core.c (swap_abort): Ditto & make static. * irix-core.c (swap_abort): Ditto & make static. * ptrace-core.c (swap_abort): Ditto & make static. * trad-core.c (swap_abort): Ditto & make static. * coffswap.h (coff_swap_reloc_in): Ditto. (coff_swap_reloc_out): Ditto. (coff_swap_filehdr_in): Ditto. (coff_swap_filehdr_out): Ditto. (coff_swap_sym_in): Ditto. (coff_swap_sym_out): Ditto. (coff_swap_aux_in): Ditto. (coff_swap_aux_out): Ditto. (coff_swap_lineno_in): Ditto. (coff_swap_lineno_out): Ditto. (coff_swap_aouthdr_in): Ditto. (coff_swap_aouthdr_out): Ditto. (coff_swap_scnhdr_in): Ditto. (coff_swap_scnhdr_out): Ditto. * ihex.c (ihex_sizeof_headers): Ditto. * tekhex.c (getsym): Ditto. (find_chunk): Ditto & make static. (insert_byte): Ditto. (first_phase): Ditto. (pass_over): Ditto. (tekhex_get_symtab): Ditto & make static. (tekhex_get_symtab_upper_bound): Ditto & make static. (tekhex_mkobject): Ditto. (tekhex_object_p): Ditto. (move_section_contents): Ditto. (tekhex_get_section_contents): Ditto. (tekhex_set_arch_mach): Ditto & make static. (tekhex_set_section_contents): Ditto. (writevalue): Ditto. (writesym): Ditto. (out): Ditto. (tekhex_write_object_contents): Ditto. (tekhex_sizeof_headers): Ditto. (tekhex_make_empty_symbol): Ditto. (tekhex_get_symbol_info): Ditto. (tekhex_print_symbol): Ditto. * irix-core.c (make_bfd_asection): Ditto. (irix_core_core_file_p): Ditto. (irix_core_core_file_failing_command): Ditto. (irix_core_core_file_failing_signal): Ditto. (irix_core_core_file_matches_executable_p): Ditto. (irix_core_make_empty_symbol): Ditto. * coff-mips.c (mips_bfd_reloc_type_lookup): Ditto. * srec.c (srec_new_symbol): Ditto. (srec_get_section_contents): Ditto. (srec_set_arch_mach): Ditto. (srec_set_section_contents): Ditto. (internal_srec_write_object_contents): Ditto. (srec_write_object_contents): Ditto. (symbolsrec_write_object_contents): Ditto. (srec_sizeof_headers): Ditto. (srec_make_empty_symbol): Ditto. (srec_get_symtab_upper_bound): Ditto. (srec_get_symtab): Ditto. (srec_print_symbol): Ditto and make static. * elf.c (elf_read): Ditto (assign_section_numbers): Ditto. (elf_fake_sections): Ditto. (sym_is_global): Ditto. (elf_map_symbols): Ditto. (get_program_header_size): Ditto. * coffgen.c (make_a_section_from_file): Ditto. (coff_real_object_p): Ditto. (fixup_symbol_value): Ditto. (build_debug_section): Ditto. (copy_name): Ditto. * syms.c (coff_section_type): Ditto.
1996-09-09 * config.bfd,configure.in,configure: Add m32r support.David Edelsohn1-7/+29
* Makefile.in,archures.c,elf.c,targets.c: Likewise.
1996-08-05 * elf.c (_bfd_elf_make_section_from_shdr): For a loadable section,Ian Lance Taylor1-1/+5
only get the LMA from the phdr if they are in the same part of the file.
1996-08-05 * elf.c (map_sections_to_segments): Rewrite tests for starting aIan Lance Taylor1-22/+61
new segment to make them more comprehensible. If the relationship between the LMA and the VMA changed, start a new segment. Don't check dynsec when deciding whether to start a new segment for a writeable section; -N will now handle this.
1996-07-31 Make ld -N more reasonable for ELF:Ian Lance Taylor1-7/+28
* elf.c (map_sections_to_segments): If D_PAGED is not set, set phdr_in_section to false, and always use a single load segment. (elf_sort_sections): Sort sections by LMA after VMA. (assign_file_positions_for_segments): If D_PAGED is not set, don't align to maxpagesize. (assign_file_positions_except_relocs): Likewise. * elfcode.h (elf_object_p): If a section is loaded but not page aligned, clear D_PAGED.
1996-07-24 * elf.c (assign_file_positions_for_segments): Track the virtualIan Lance Taylor1-2/+6
memory position separately from the file position, and use it to compute the alignment adjustment. PR 10039.
1996-07-18start-sanitize-d10vMartin Hunt1-6/+24
Wed Jul 17 14:51:52 1996 Martin M. Hunt <hunt@pizza.cygnus.com> * Makefile.in (ALL_MACHINES): Add cpu-d10v.o (BFD32_BACKENDS) Add elf32-d10v.o * archures.c: Add bfd_d10v_arch. * bfd-in2.h: Add bfd_d10v_arch. * config.bfd (d10v-*-*): New target. * configure: (bfd_elf32_d10v_vec) New vector. * configure.in: (bfd_elf32_d10v_vec) New vector. * cpu-d10v.c: New file. * elf.c (prep_headers): Added case bfd_arch_d10v. * elf32-d10v.c: New file. * libbfd.h: Rebuild. * reloc.c (BFD_RELOC_D10V_10_PCREL_R, BFD_RELOC_D10V_10_PCREL_L, BFD_RELOC_D10V_18, BFD_RELOC_D10V_18_PCREL): Define. * targets.c (bfd_elf32_d10v_vec): New vector. end-sanitize-d10v
1996-06-19 * elf.c (map_sections_to_segments): Fix up the test for -Ttext toIan Lance Taylor1-8/+114
approximate the correct answer if SIZEOF_HEADERS was not used.
1996-05-29 64-bit MIPS ELF ABI objdump support:Ian Lance Taylor1-17/+11
* elf64-mips.c: New file. * Makefile.in: Rebuild dependencies. (BFD64_BACKENDS): Add elf64-mips.o. (BFD64_BACKENDS_CFILES): Add elf64-mips.c. * config.bfd (mips*el-*-elf*) Add bfd_elf64_bigmips_vec and bfd_elf64_littlemips_vec to targ_selvecs. (mips*-*-elf*): Likewise. * confingure.in: Add bfd_elf64_bigmips_vec and bfd_elf64_littlemips_vec to vector switch. * configure: Rebuild. * elf32-mips.c (_bfd_mips_elf_section_from_shdr): New function, broken out of mips_elf_section_from_shdr. (mips_elf32_section_from_shdr): Rename from mips_elf_section_from_shdr. Call new function. (elf_backend_section_from_shdr): Update name of renamed function. * elf-bfd.h (struct elf_size_info): Change second parameter of write_out_phdrs to be const. Likewise for second parameter of swap_symbol_out. (struct bfd_elf_section_data): Add rel_hdr2 field. (bfd_elf32_swap_symbol_in): Change second parameter to be const. (bfd_elf32_swap_symbol_out): Likewise. (bfd_elf32_swap_reloc_in): Likewise. (bfd_elf32_swap_reloc_out): Likewise. (bfd_elf32_swap_reloca_in): Likewise. (bfd_elf32_swap_reloca_out): Likewise. (bfd_elf32_swap_phdr_in): Likewise. (bfd_elf32_swap_phdr_out): Likewise. (bfd_elf32_swap_dyn_in): Likewise. (bfd_elf32_swap_dyn_out): Likewise. (bfd_elf32_slurp_symbol_table): Declare. (bfd_elf32_write_shdrs_and_ehdr): Declare. (bfd_elf32_write_out_phdrs): Declare. (bfd_elf64_swap_symbol_in): Change second parameter to be const. (bfd_elf64_swap_symbol_out): Likewise. (bfd_elf64_swap_reloc_in): Likewise. (bfd_elf64_swap_reloc_out): Likewise. (bfd_elf64_swap_reloca_in): Likewise. (bfd_elf64_swap_reloca_out): Likewise. (bfd_elf64_swap_phdr_in): Likewise. (bfd_elf64_swap_phdr_out): Likewise. (bfd_elf64_swap_dyn_in): Likewise. (bfd_elf64_swap_dyn_out): Likewise. (bfd_elf64_slurp_symbol_table): Declare. (bfd_elf64_write_shdrs_and_ehdr): Declare. (bfd_elf64_write_out_phdrs): Declare. (_bfd_mips_elf_section_from_shdr): Declare. * elf.c (bfd_section_from_shdr): Remove assertion requiring SHT_REL/SHT_RELA to match use_rela_p. If there is already a reloc section for the section, add the new one to rel_hdr2. Increment reloc_count rather than setting it. * elfcode.h (elf_slurp_symbol_table): Define name as macro. Remove static declaration. (elf_write_shdrs_and_ehdr): Define name as macro. (elf_write_out_phdrs): Likewise. (elf_swap_ehdr_in, elf_swap_ehdr_out): Declare. (elf_swap_shdr_in, elf_swap_shdr_out): Declare. (elf_swap_symbol_in): Change second parameter to be const. (elf_swap_symbol_out): Likewise. (elf_swap_ehdr_in, elf_swap_ehdr_out): Likewise. (elf_swap_shdr_in, elf_swap_shdr_out): Likewise. (elf_swap_phdr_in, elf_swap_phdr_out): Likewise. (elf_swap_reloc_in, elf_swap_reloc_out): Likewise. (elf_swap_reloca_in, elf_swap_reloca_out): Likewise. (elf_write_out_phdrs): Rename from write_out_phdrs. Change second parameter to be const. Make non-static. (elf_write_shdrs_and_ehdr): Rename from write_shdrs_and_ehdr. Make non-static. (elf_slurp_symbol_table): Make non-static. (NAME(_bfd_elf,size_info)): Update names of renamed functions. * elfxx-target.h (elf_info_to_howto): Define if not defined. (elf_backend_size_info): Likewise. (elfNN_bed): Use elf_backend_size_info. * targets.c (bfd_elf64_bigmips_vec): Declare. (bfd_elf64_littlemips_vec): Declare. (bfd_target_vector): Add bfd_elf64_bigmips_vec and bfd_elf64_littlemips_vec if BFD64 is defined.
1996-04-02 * elf-bfd.h (struct elf_link_hash_table): Add hgot field.Ian Lance Taylor1-4/+3
* elf.c (_bfd_elf_link_hash_table_init): Initialize hgot field. * elflink.c (_bfd_elf_create_got_section): Store the _GLOBAL_OFFSET_TABLE_ hash table entry in the hgot field. * elf32-sparc.c (elf32_sparc_check_relocs): If the size of the global offset table goes over 0x1000, set the value of _GLOBAL_OFFSET_TABLE_ to 0x1000 into the section. (elf32_sparc_relocate_section): Subtract the offset of _GLOBAL_OFFSET_TABLE_ when handling GOT relocations. PR 9323.
1996-03-04 * elf.c (_bfd_elf_symbol_from_bfd_symbol): Print a useful errorIan Lance Taylor1-4/+17
message rather than calling BFD_ASSERT. * elfcode.h (write_relocs): Check return value of _bfd_elf_symbol_from_bfd_symbol.
1996-02-28 * elf.c (assign_file_positions_for_segments): Adjust the segmentIan Lance Taylor1-3/+5
memory size for the alignment of a SEC_ALLOC section, not just a SEC_LOAD section.
1996-02-24 * elf.c (bfd_elf_set_dt_needed_name): Don't do anything if theIan Lance Taylor1-3/+19
format is not bfd_object. (bfd_elf_get_dt_soname): Likewise.
1996-02-15 * elf.c (map_sections_to_segments): If we have a .dynamic section,Ian Lance Taylor1-10/+38
then start a new segment rather than put a writable section in a readonly segment.
1996-02-01 * elf-bfd.h (ELF_LINK_NON_ELF): Define.Ian Lance Taylor1-1/+5
* elf.c (_bfd_elf_link_hash_newfunc): Set elf_link_hash_flags to ELF_LINK_NON_ELF. * elflink.h (elf_link_add_object_symbols): Reset ELF_LINK_NON_ELF flag for a newly defined symbol. (NAME(bfd_elf,record_link_assignment)): Likewise. (elf_adjust_dynamic_symbol): If ELF_LINK_NON_ELF is set, try to set the DEF or REF_REGULAR flags correctly.
1996-01-29 Based on patches from Ronald F. Guilmette <rfg@monkeys.com>:Ian Lance Taylor1-8/+10
* syms.c (BSF_OBJECT): Define. (bfd_print_symbol_vandf): Print 'O' for BSF_OBJECT. * bfd-in2.h: Rebuild. * elfcode.h (elf_slurp_symbol_table): Set BSF_OBJECT for an STT_OBJECT symbol. * elf.c (swap_out_syms): Only set type to STT_OBJECT if BSF_OBJECT is set.
1996-01-26 * syms.c: Include "bfdlink.h".Ian Lance Taylor1-3/+19
(struct stab_find_info): Define. (_bfd_stab_section_find_nearest_line): New function. * libbfd-in.h (_bfd_stab_section_find_nearest_line): Declare. * libbfd.h: Rebuild. * elf-bfd.h (struct elf_obj_tdata): Add line_info field. * elf.c (_bfd_elf_find_nearest_line): Try calling _bfd_stab_section_find_nearest_line before searching the ELF symbol table. Find the closest STT_FUNC symbol, not the last one. * libcoff-in.h (coff_data_type): Add line_info field. * libcoff.h: Rebuild. * coffgen.c (coff_find_nearest_line): Try calling _bfd_stab_section_find_nearest_line before searching the COFF symbol table. * Makefile.in: Rebuild dependencies.
1996-01-16 * elf.c (assign_file_positions_for_segments): Don't increment fileIan Lance Taylor1-9/+14
offset for a segment which contains no loadable sections.
1996-01-15update copyrightsIan Lance Taylor1-1/+1
1996-01-12 * elf.c (assign_file_positions_for_segments): If a segmentIan Lance Taylor1-2/+7
contains no sections, don't mark it as readable.
1996-01-12tweak last changeIan Lance Taylor1-2/+2
1996-01-12 * elf.c (_bfd_elf_print_private_bfd_data): Dump contents ofIan Lance Taylor1-34/+136
dynamic section, if there is one. * elf-bfd.h (struct elf_size_info): Add swap_dyn_in field. (bfd_elf32_swap_dyn_in): Change type of second parameter to PTR. (bfd_elf64_swap_dyn_in): Likewise. * elfcode.h (elf_swap_dyn_in): Change type of second parameter to PTR. (NAME(_bfd_elf,size_info)): Initialize swap_dyn_in field.
1996-01-11 * elf32-mips.c: Extensive changes for a start at dynamic linkingIan Lance Taylor1-16/+16
support, from Kazumoto Kojima <kkojima@info.kanagawa-u.ac.jp>. * elf-bfd.h (struct elf_backend_data): Add type_change_ok field. (struct elf_backend_data): Remove elf_backend_create_program_headers field. Add elf_backend_additional_program_headers and elf_backend_modify_segment_map fields. * elfxx-target.h (elf_backend_type_change_ok): Define if not defined. (elf_backend_additional_program_headers): Likewise. (elf_backend_modify_segment_map): Likewise. (elf_backend_create_program_headers): Don't define. (elfNN_bed): Change to account for field changes. * elf.c (assign_file_positions_for_segments): Call new modify_segment_map backend function. Don't call old create_program_headers backend function. (get_program_header_size): Call additional_program_headers rather than create_program_headers. * elflink.h (elf_link_add_object_symbols): Initialize type_change_ok from new backend field. (elf_link_output_extsym): Don't warn if _rld_new_interface is defined. (elf_reloc_link_order): Treat a reloc against a defined symbol as a reloc against the appropriate section.
1995-12-21* elf.c (copy_private_bfd_data): When attaching sections to segments ignoreKen Raeburn1-1/+3
sections that won't be allocated. Patch from Andreas Schwab.
1995-12-01 * elf.c (assign_file_positions_for_segments): Sort the sections inIan Lance Taylor1-3/+17
each segment. (get_program_header_size): Return the right size if segment_map is not NULL. (copy_private_bfd_data): Don't bother to sort the sections.
1995-12-01 * libbfd.c (bfd_malloc, bfd_realloc): New functions.Ian Lance Taylor1-11/+5
(bfd_zmalloc): Return PTR, not char *. Take size_t, not bfd_size_type. * libbfd-in.h (bfd_malloc, bfd_realloc): Declare. (bfd_zmalloc): Change declaration. * libbfd.h: Rebuild. * Many files: Use bfd_malloc and bfd_realloc rather than malloc and realloc. Don't set bfd_error_no_memory if they fail.
1995-11-30 * elf.c (_bfd_elf_make_section_from_shdr): Don't set lma based onIan Lance Taylor1-69/+133
p_paddr if p_paddr is zero. (make_mapping): Set includes_filehdr and includes_phdrs for first PT_LOAD segment. (map_sections_to_segments): Set includes_phdrs for PT_PHDR segment. (assign_file_positions_for_segments): Handle includes_filehdr and includes_phdrs. Remove special handling of PT_PHDR and first PT_LOAD segments. (copy_private_bfd_data): Set includes_filehdr and includes_phdr when appropriate. Remove special handling of PT_PHDR segment. Use a more complex condition for when a section is included in a segment to handle Solaris linker oddities.
1995-11-29 * opncls.c (bfd_alloc_by_size_t): Set bfd_error_no_memory ifIan Lance Taylor1-74/+18
obstack_alloc fails. (bfd_alloc_finish): Set bfd_error_no_memory if obstack_finish fails. * libbfd.c (bfd_zmalloc): Set bfd_error_no_memory if malloc fails. * Many files: don't set bfd_error_no_memory if one of the above routines fails.
1995-11-29 * elf.c (assign_file_positions_for_segments): Don't adjust p_paddrIan Lance Taylor1-3/+119
if p_paddr_valid is set. (copy_private_bfd_data): New static function. (_bfd_elf_copy_private_section_data): Call copy_private_bfd_data.
1995-11-29 * elf.c (assign_file_positions_for_segments): Fix case where extraIan Lance Taylor1-11/+8
program headers were allocated.
1995-11-29 * elf.c (_bfd_elf_print_private_bfd_data): New function.Ian Lance Taylor1-0/+55
* elf-bfd.h (_bfd_elf_print_private_bfd_data): Declare. * elfxx-target.h (bfd_elfNN_bfd_print_private_bfd_data): Define to _bfd_elf_print_private_bfd_data.
1995-11-28 * elf-bfd.h (struct elf_obj_tdata): Add segment_map field.Ian Lance Taylor1-516/+698
* elf.c (make_mapping): New static function. (map_sections_to_segments): New static function. (elf_sort_sections): New static function. (assign_file_positions_for_segments): New static function. (map_program_segments): Remove. (get_program_header_size): Remove sorted_hdrs, count, and maxpagesize parameters. Simplify. (assign_file_positions_except_relocs): When generating an executable, use assign_file_positions_for_segments. (elf_sort_hdrs): Remove. (_bfd_elf_sizeof_headers): Remove eliminated parameters from call to get_program_header_size.
1995-11-01 * elf.c (bfd_elf_set_dt_needed_name): Don't do anything if theIan Lance Taylor1-1/+4
BFD is not of the right type. (bfd_elf_get_needed_list): Likewise. * i386linux.c (bfd_linux_size_dynamic_sections): Likewise. * sunos.c (bfd_sunos_get_needed_list): Likewise. * xcofflink.c (XCOFF_XVECP): Define. (bfd_xcoff_link_record_set): Don't do anything if the BFD is not of the right type. (bfd_xcoff_import_symbol): Likewise. (bfd_xcoff_export_symbol): Likewise. (bfd_xcoff_link_count_reloc): Likewise. (bfd_xcoff_record_link_assignment): Likewise. (bfd_xcoff_size_dynamic_sections): Likewise.
1995-10-31 * libelf.h: Rename to elf-bfd.h to avoid conflict withFred Fish1-1/+1
systems that have a system <libelf.h>. * Makefile.in: Globally replace libelf.h with elf-bfd.h. * bfd.c, elf.c, elf32-arc.c, elf32-gen.c, elf32-hppa.c, elf32-hppa.h, elf32-i386.c, elf32-i860.c, elf32-m68k.c, elf32-m88k.c, elf32-mips.c, elf32-ppc.c, elf32-sparc.c, elf64-gen.c, elf64-sparc.c, elfcode.h, elflink.c, elfxx-target.h: Include elf-bfd.h rather than libelf.h. * elfxx-target.h: Change libelf.h reference to elf-bfd.h.
1995-10-30 * elf.c (elf_fake_sections): Remove bogus BFD_ASSERT.Ian Lance Taylor1-21/+19
PR 8293.
1995-10-03 * elf.c (_bfd_elf_assign_file_position_for_section): AlwaysJeff Law1-33/+16
align to the section's alignment. "align" argument removed; all callers changed. Loosely based on a patch from dupuy@smarts.com; keeps dbx from losing when debugging programs that have been objcopy'd.
1995-09-12 Extensive minor changes to avoid various gcc warnings. Also:Ian Lance Taylor1-13/+78
* Makefile.in (BFD32_BACKENDS): Remove coff-arm.o. * archures.c (bfd_arch_info_type): Change mach field from long to unsigned long. (bfd_lookup_arch): Change machine parameter from long to unsigned long.
1995-07-11 * libelf.h (struct elf_size_info): Change type of last argument toIan Lance Taylor1-2/+2
swap_symbol_out from char * to PTR. (bfd_elf32_swap_symbol_out): Update declaration. (bfd_elf64_swap_symbol_out): Likewise. * elfcode.h (elf_swap_symbol_out): Change type of cdst from char * to PTR. * elf.c (swap_out_syms): Cast to PTR, not char *, when calling swap_symbol_out routine. * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Likewise. (elf_link_output_sym): Likewise. (elf_link_output_extsym): Likewise. * elf32-sparc.c (elf32_sparc_finish_dynamic_sections): Likewise.