aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.c
AgeCommit message (Collapse)AuthorFilesLines
2004-03-18bfd/Alan Modra1-21/+3
* elf-bfd.h (struct elf_obj_tdata): Delete dt_soname field. Add dyn_lib_class field. Rearrange for better packing. (elf_dt_soname): Delete. (elf_dyn_lib_class): Define. * elf.c (bfd_elf_set_dt_needed_name): Update comment. (bfd_elf_set_dt_needed_soname): Delete. (bfd_elf_set_dyn_lib_class): New function. * elflink.h (add_dt_needed_tag): New function. Split out from.. (elf_link_add_object_symbols): ..here. Rename "name" to "soname". Use elf_dyn_lib_class to set dt_needed and add_needed. Move fallback initialization of soname. (elf_link_check_versioned_symbol): Test elf_dyn_lib_class instead of elf_dt_soname. * bfd-in.h (enum dynamic_lib_link_class): New. (bfd_elf_set_dt_needed_soname): Delete. (bfd_elf_set_dyn_lib_class): Declare. * bfd-in2.h: Regenerate. ld/ * ld.texinfo: Add --as-needed doco. * ldmain.c (as_needed): New global var. * ldmain.h (as_needed): Declare. * lexsup.c (option_values): Add OPTION_AS_NEEDED and OPTION_NO_AS_NEEDED. (ld_options): Likewise. (parse_args): Handle them. * ldlang.h (lang_input_statement_type): Add as_needed field. * ldlang.c (new_afile): Set p->as_needed. * emultempl/elf32.em (gld${EMULATION_NAME}_load_symbols): New function. (gld${EMULATION_NAME}_try_needed): Use bfd_elf_set_dyn_lib_class. (ld_${EMULATION_NAME}_emulation): Set LDEMUL_RECOGNIZED_FILE entry. * ldlang.c (open_input_bfds): Remove useless cast. (lang_do_assignments_1): Likewise. (lang_for_each_input_section): Delete.
2004-03-05 * elf.c (map_sections_to_segments): Ignore .tbss sections forNathan Sidwell1-11/+12
layout purposes. * ldlang.c (lang_add_section): Don't force SEC_LOAD on SEC_THREAD_LOCAL. (IGNORE_SECTION): Ignore .tbss sections too. (lang_size_sections_1): .tbss sections do not advance dot. * ld-scripts/size.exp: New. * ld-scripts/size-[12].{d,s,t}: New.
2004-02-23 * ldlang.c (lang_check): Use %P, not %E, in error message.Ian Lance Taylor1-1/+1
2004-02-23 * ldlang.h (struct lang_output_section_state): Change processedNathan Sidwell1-3/+12
field's type. * ldexp.c (check, invalid): Remove. (fold_name): Move valid_p assignments. Create undefined symbol when needed. Directly exampine section's processd flag. * ldlang.c (lang_output_section_statement_lookup): Adjust processed field init. (lang_size_sections_1): Allow LOADADDR when determining section's VMA. Adjust error message. Fold data statement's expr. (lang_size_sections): Correctly increment lang_statement_iteration. * ld-scripts/provide.exp: New. * ld-scripts/provide-{1,2,3}.{s,t,d}.exp: New. * ldexp.c (fold_tree): Follow indirect symbols.
2004-02-19 * ldlang.c (map_input_to_output_sections): Initialize sectionsNathan Sidwell1-2/+7
mentioned in a data statement expression. (lang_do_assignments_1): Add data statement's expression's section's vma. * ld-scripts/data.{s,t,d,exp}: New.
2004-02-18 * ldgram.y (statement_anywhere): Add assert rule.Nathan Sidwell1-0/+4
* ldlang.c (exp_init_os): Add assert case. * testsuite/ld-scripts/assert.{s,t,exp}: New.
2004-01-13* ldlang.c (lang_get_regions): Add extra parameter 'have_vma' which if true willNick Clifton1-21/+25
prevent the LMA region being used as a replacement for a default VMA region. (lang_leave_output_section_statement): Pass extra parameter. (lang_leave_overlay): Likewise. * ld.texinfo (Output Section LMA): Document that the LMA region can be set to the VMA region if no VMA has been set. * ldlang.h (struct lang_output_section_phdr_list): Create a typedef for this type. Minor formatting fixes.
2004-01-13If dot is advanced, then assume that the section should be allocated.Nick Clifton1-0/+6
2004-01-12 * ldlang.c (IGNORE_SECTION): Don't ignore SEC_ALLOC && !SEC_LOADAlan Modra1-4/+2
sections. Do ignore SEC_NEVER_LOAD sections. (lang_size_sections_1): Remove test made redundant with the above.
2004-01-03 * ldexp.c (align_n): Make static.Alan Modra1-69/+75
* ldexp.h (align_n): Delete declaration. * ldlang.h (lang_enter_output_section_statement): Remove block_value param. * ldlang.c (lang_enter_output_section_statement): Likewise. (TO_ADDR, TO_SIZE): Define. (opb): New var. (init_opb): New function. (print_input_section): Call init_opb and use TO_ADDR. (print_data_statement, print_reloc_statement): Likewise. (print_padding_statement): Likewise. (size_input_section): Use TO_SIZE and TO_ADDR, and global opb. (lang_check_section_addresses): Likewise. (lang_size_sections_1): Likewise. (lang_do_assignments_1): Likewise. (lang_set_startof): Likewise. (lang_one_common): Likewise. Combine power_of_two and opb alignment. (lang_process): Call init_opb. (lang_abs_symbol_at_end_of): Use TO_ADDR and global opb. (lang_enter_overlay_section): Adjust lang_enter_output_section_statement call. * ldgram.y: Likewise. * mri.c (mri_draw_tree): Likewise. * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Likewise. * emultempl/mmo.em (mmo_place_orphan): Likewise. * emultempl/pe.em (gld${EMULATION_NAME}_place_orphan): Likewise.
2003-12-082003-12-07 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu1-1/+1
* ldlang.c (lang_vers_match): Pass "DMGL_PARAMS | DMGL_ANSI" to cplus_demangle.
2003-12-04bfd/H.J. Lu1-2/+2
2003-12-04 H.J. Lu <hongjiu.lu@intel.com> * elfxx-ia64.c (elfNN_ia64_relax_section): Use the need_relax_finalize field in link_info instead of relax_finalizing to check if the relax finalize pass is being done. include/ 2003-12-04 H.J. Lu <hongjiu.lu@intel.com> * bfdlink.h (bfd_link_info): Change relax_finalizing to need_relax_finalize. ld/ 2003-12-04 H.J. Lu <hongjiu.lu@intel.com> * emultempl/ia64elf.em (gld${EMULATION_NAME}_after_parse): Set link_info.need_relax_finalize to TRUE. * ldlang.c (lang_process): Use link_info.need_relax_finalize instead of link_info.relax_finalizing. * ldmain.c (main): Likewise.
2003-12-04 * ldlang.c (lang_do_assignments): Function return is void.Alan Modra1-1/+1
* ldlang.h (lang_do_assignments): Ditto. * emultempl/netbsd.em (gld${EMULATION_NAME}_before_parse): Declare. * Makefile.am (ens32knbsd.c): Depend on netbsd.em. * Makefile.in: Regenerate.
2003-11-19Fix IA-64 linker failure reported by Andreas Schwab.Jim Wilson1-3/+5
* ldlang.c (lang_process): Move lang_reset_memory_regions call after lang_do_assignments call.
2003-10-31When looking for a previously loaded file compare the local_sym_name not theNick Clifton1-4/+9
filename, as the filename might have been transformed via the search directory path lookup. If the sought-for file has not been found in the input file chain then create a new node with the search_dirs_flag set so that the entire set of directory paths will be scanned for it.
2003-10-25 * ChangeLog-9197: Fix typos.Kazu Hirata1-2/+2
* NEWS: Likewise. * ld.texinfo: Likewise. * ldlang.c: Fix comment typos.
2003-10-242003-10-24 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu1-1/+1
* ldlang.c (lang_vers_match): Fix a typo.
2003-10-242003-10-24 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu1-3/+3
* ldlang.c (lang_vers_match): Check demangled symbols.
2003-10-24bfd/H.J. Lu1-24/+68
2003-10-24 H.J. Lu <hongjiu.lu@intel.com> * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Look up hash table for real symbols. include/ 2003-10-24 H.J. Lu <hongjiu.lu@intel.com> * bfdlink.h (bfd_elf_version_expr): Add "symbol" and remove "wildcard". ld/ 2003-10-24 H.J. Lu <hongjiu.lu@intel.com> * ldlang.c (lang_vers_match): Check "symbol" instead of "wildcard" and "pattern". Fix a typo. (lang_finalize_version_expr_head): Likewise. (lang_register_vers_node): Likewise. (realsymbol): New function. (lang_new_vers_pattern): Set "symbol" and remove "wildcard". * ldlex.l (V_IDENTIFIER): Allow '\\'.
2003-10-22bfd/Jakub Jelinek1-67/+231
* elflink.c (_bfd_elf_export_symbol): Adjust for globals and locals field changes. (_bfd_elf_link_assign_sym_version): Likewise. * elflink.h (size_dynamic_sections): Likewise. include/ * bfdlink.h (struct bfd_elf_version_expr): Remove match field. Add wildcard and mask fields. (BFD_ELF_VERSION_C_TYPE): Define. (BFD_ELF_VERSION_CXX_TYPE): Likewise. (BFD_ELF_VERSION_JAVA_TYPE): Likewise. (struct bfd_elf_version_expr_head): New. (struct bfd_elf_version_tree): Add match field. Change type of globals and locals fields to struct bfd_elf_version_expr_head. ld/ * ldlang.c: Include hashtab.h. (lang_vers_match_lang_c, lang_vers_match_lang_cplusplus, lang_vers_match_lang_java): Remove. (lang_vers_match): New function. (lang_new_vers_pattern): Initialize wildcard and mask fields, don't initialize match. (lang_new_vers_node): Use xcalloc. Adjust for globals and locals field type changes. Set match field. (version_expr_head_hash, version_expr_head_eq): New functions. (lang_finalize_version_expr_head): New function. (lang_register_vers_node): Call lang_finalize_version_expr_head. Search in hash table if not wildcard when looking for duplicates. * emultempl/ppc64elf.em (new_vers_pattern): Don't bother with duplicate checking. Initialize all fields of dot_entry from entry with the exception of pattern and next.
2003-10-21Add warning messages for the use of an undeclared memory region and theNick Clifton1-22/+35
redefintion of an already declared region.
2003-10-17 * ldlang.c (lang_size_sections): Last, set _cooked_size for outputHans-Peter Nilsson1-0/+9
sections.
2003-10-11 * ld.texinfo (Builtin Functions) <DEFINED>: Say that only symbolsHans-Peter Nilsson1-14/+129
defined before the statement using DEFINED yield 1. * ldexp.c (fold_name) <case DEFINED>: In lang_first_phase_enum, call lang_track_definedness on symbol. In subsequent phases, use lang_symbol_definition_iteration and lang_statement_iteration to check whether the symbol was defined before the current statement. (exp_fold_tree) <case etree_assign et al>: Call lang_update_definedness before updating symbol type when setting symbol. * ldlang.c (lang_definedness_table): New variable. (lang_definedness_newfunc, lang_track_definedness) (lang_symbol_definition_iteration, lang_update_definedness): New functions. (lang_init): Initialize lang_definedness_table and lang_statement_iteration. (lang_finish): Destroy bfd_hash_table_free. (lang_size_sections): Increment lang_statement_iteration. (lang_do_assignments_1): New function with former lang_do_assignments contents. Change recursive calls to call this function. (lang_do_assignments): Evacuate contents. Increment lang_statement_iteration, then just call lang_do_assignments_1. * ldlang.h (struct lang_definedness_hash_entry) (lang_statement_iteration, lang_track_definedness) (lang_symbol_definition_iteration, lang_update_definedness): Declare.
2003-10-08* ldlang.c (lang_size_sections_1): Use IGNORE_SECTION to tellAlexandre Oliva1-2/+1
whether to skip test for no memory region.
2003-07-27 * ld.texinfo: Typo fixes. Document SUBALIGN.Alan Modra1-3/+8
* ldgram.y (opt_subalign): Add. * ldlex.l (SUBALIGN): Recognize. * ldlang.c (overlay_subalign): New var. (lang_enter_overlay): Add subalign param. (lang_enter_overlay_section): Pass overlay_subalign to lang_enter_output_section_statement. * ldlang.h (lang_enter_overlay): Update.
2003-06-28Convert to C90Alan Modra1-733/+394
2003-06-25Correct spelling of "relocatable".Alan Modra1-14/+14
2003-06-18bfd/H.J. Lu1-1/+4
2003-06-17 H.J. Lu <hongjiu.lu@intel.com> * section.c (struct sec): Put back kept_section. (STD_SECTION): Put back kept_section initialization. * bfd-in2.h: Regenerate. * elflink.h (elf_link_input_bfd): Also check discarded linkonce sections for relocateable output. Use kept_section to preserve debug information discarded by linkonce. ld/ 2003-06-17 H.J. Lu <hongjiu.lu@intel.com> * ldlang.c (section_already_linked): Put back assignment of kept_section.
2003-05-09Default to generating a fatal error message if a loadable section is notNick Clifton1-4/+20
allocated to a memory region when regions are defined.
2003-04-29bfd/H.J. Lu1-0/+8
2003-04-28 H.J. Lu <hjl@gnu.org> * elfxx-ia64.c (elfNN_ia64_relax_section): Relax ldxmov during the relax finalize pass. * section.c (struct sec): Add need_finalize_relax and remove flag11. (STD_SECTION): Update struct sec initializer. * bfd-in2.h: Regenerated. include/ 2003-04-28 H.J. Lu <hjl@gnu.org> * bfdlink.h (bfd_link_info): Add relax_finalizing. ld/ 2003-04-28 H.J. Lu <hjl@gnu.org> * ldlang.c (lang_process): Add the relax finalize pass. * ldmain.c (main): Initialize link_info.relax_finalizing to FALSE.
2003-03-31Fix memory leaksNick Clifton1-0/+1
2003-03-03* ldfile.h (struct search_dirs): Added sysrooted field.Alexandre Oliva1-0/+7
* ldlang.h (struct lang_input_statement_struct): Likewise. * ldfile.c (ldfile_add_library_path): Mark sysrooted paths. (ldfile_open_file_search): Look for sysrooted filename starting with / in ld_sysroot instead of in the current directory. Clear sysrooted flag if it's found in the current directory. Set it from the search directory's sysrooted flag where it is found otherwise. * ldlang.c (ldlang_sysrooted_script): New static variable. (new_afile): Mark search_file_enums as sysrooted if ldlang_sysrooted_script. (load_symbols): Set ldlang_sysrooted_script according to the script's sysrooted field while processing it. * ld.texinfo: Document INPUT behavior in sysroot.
2003-02-21Disable region size checking whilst relaxing sections.Nick Clifton1-24/+42
2003-01-02 * ldfile.c: Fix comment typos.Kazu Hirata1-5/+5
* ldlang.c: Likewise. * mri.c: Likewise. * pe-dll.c: Likewise.
2002-12-23Change linker's default behaviour - it will now reject binary files whoesNick Clifton1-1/+2
architecture it does not recognise, unless it has explicitly told to accept them.
2002-12-06 * ldlang.c (init_os): Ensure sections mentioned in load_baseAlan Modra1-0/+3
are initialized.
2002-11-30s/boolean/bfd_boolean/ s/true/TRUE/ s/false/FALSE/. SimplifyAlan Modra1-178/+220
comparisons of bfd_boolean vars with TRUE/FALSE. Formatting.
2002-11-12 * ldlang.c (lang_add_section): Discard debugging sections that haveAlan Modra1-4/+5
been marked SEC_EXCLUDE.
2002-10-30 * emultempl/aix.em: Use include <> for generated headers.Daniel Jacobowitz1-1/+1
* emultempl/beos.em: Likewise. * emultempl/elf32.em: Likewise. * emultempl/pe.em: Likewise. * ldctor.c: Likewise. * ldexp.c: Likewise. * ldfile.c: Likewise. * ldlang.c: Likewise. * ldlex.c: Likewise. * ldlex.l: Likewise. * ldmain.c: Likewise. * ldmisc.c: Likewise. * ldwrite.c: Likewise. * lexsup.c: Likewise. * mri.c: Likewise. * pe-dll.c: Likewise.
2002-10-15 * ldlang.c (load_symbols): Revert last change.Alan Modra1-3/+1
2002-10-14 * ldlang.c (load_symbols): Don't call bfd_link_add_symbols whenAlan Modra1-11/+12
just_syms_flag. (lang_reasonable_defaults): Don't compare against false. (size_input_section): Likewise. (lang_size_sections_1): Likewise. (lang_do_assignments): Likewise. (lang_add_output): Likewise.
2002-10-10 * ldfile.c (ldfile_try_open_bfd): When searching skip linker scripts ifJakub Jelinek1-18/+24
they have OUTPUT_FORMAT not matching actual output format. * ldlang.c (lang_get_output_target): New function. (open_output): Use it. * ldlang.h (lang_get_output_target): New prototype.
2002-10-082002-10-08 H.J. Lu <hjl@gnu.org>H.J. Lu1-26/+0
* ldlang.c (lang_file_exist): Removed. (new_afile): Revert the last change. * ldlang.h (lang_file_exist): Removed. * lexsup.c (parse_args): Revert the last change.
2002-10-07Abort if the filename to be added matches the linker output filename.Nick Clifton1-13/+39
2002-08-20 * ldlang.c (offsetof): Define if not defined.Alan Modra1-0/+4
2002-08-13 * emulparams/elf32_dlx.sh (TARGET_PAGE_SIZE): Set to 1.Alan Modra1-4/+3
(MAXPAGESIZE): Set to 1. * ld.h (ALIGN_N): Delete. * ldexp.h (align_n): Declare. * ldexp.c (align_n): New function. (fold_binary): Use align_n instead of ALIGN_N. (exp_fold_tree): Likewise. * ldlang.c (lang_size_sections_1): Likewise. (lang_one_common): Likewise.
2002-08-08Check symbols with undefine version.H.J. Lu1-0/+2
2002-07-30 * elf.c (elf_fake_sections): Fix up .tbss sh_size and sh_type.Jakub Jelinek1-2/+3
* ldlang.c (lang_add_section): Don't turn .tbss into normal sections for relocatable link. (lang_size_sections_1): Don't make .tbss zero size for relocatable link.
2002-07-05 * ldlang.c (print_wild_statement): Fix output formatting.Alan Modra1-3/+5
2002-07-04 * ldlang.c: (strip_excluded_output_sections): New function.Alan Modra1-8/+39
(lang_process): Call it. (lang_size_sections_1): Revert 2002-06-10 change.