summaryrefslogtreecommitdiff
path: root/ld/ldmain.c
Commit message (Collapse)AuthorAgeFilesLines
* 2002-05-21 H.J. Lu (hjl@gnu.org)H.J. Lu2002-05-221-0/+1
| | | | | | | | | | | | | | | | * emultempl/elf32.em (gld${EMULATION_NAME}_parse_args): Handle "-z muldefs". (gld${EMULATION_NAME}_list_options): Add "-z muldefs". * ld.texinfo: Updated for --allow-multiple-definition and "-z muldefs". * ldmain.c (main): Initialize the allow_multiple_definition field to false. * lexsup.c (OPTION_ALLOW_MULTIPLE_DEFINITION): New. (ld_options): Add --allow-multiple-definition. (parse_args): Support OPTION_ALLOW_MULTIPLE_DEFINITION.
* * ldmain.c (main): Enable -z combreloc by default.Jakub Jelinek2002-05-101-1/+1
|
* * ld.h: Fix formatting.Kazu Hirata2002-05-031-5/+5
| | | | | | | | | * ldexp.c: Likewise. * ldfile.c: Likewise. * ldlang.c: Likewise. * ldmain.c: Likewise. * lexsup.c: Likewise. * pe-dll.c: Likewise.
* * ldmain.c (main): Move .text readonly flag fudges from here..Alan Modra2002-03-181-14/+0
| | | | * ldlang.c (lang_process): ..to here.
* Support arbitrary length fill patterns.Alan Modra2002-02-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ldexp.h (etree_value_type): Add "str" field. (union etree_union): Add "str" to "value" struct. (exp_bigintop): Declare. (exp_get_fill): Declare. * ldexp.c: Include "safe-ctype.h". (exp_intop): Set value.str to NULL. (exp_bigintop): New function. (new_rel): Pass in "str", and set new.str from it. (new_rel_from_section): Set new.str to NULL. (fold_name): Adjust calls to new_rel. (exp_fold_tree): Likewise. (exp_get_fill): New function. * ldgram.y (struct big_int bigint, fill_type *fill): New. (INT): Returns a "bigint". Adjust all code handling INTs. (fill_opt): Returns a "fill". (fill_exp): Split out of fill_opt, use for FILL. * ldlang.h (struct _fill_type): New. (fill_type): Move typedef to ldexp.h. (lang_output_section_statement_type): "fill" is now a pointer. (lang_fill_statement_type): Likewise. (lang_padding_statement_type): Likewise. (lang_add_fill): Now takes a "fill_type *" param. (lang_leave_output_section_statement): Likewise. (lang_do_assignments): Likewise. (lang_size_sections): Likewise. (lang_leave_overlay_section): Likewise. (lang_leave_overlay): Likewise. * ldlang.c: Include ldgram.h after ldexp.h. (lang_output_section_statement_lookup): Adjust for fill_type change. (print_fill_statement): Likewise. (print_padding_statement): Likewise. (insert_pad): Now takes a "fill_type *" arg. (size_input_section): Likewise. (lang_size_sections_1): Likewise. (lang_size_sections): Likewise. (lang_do_assignments): Likewise. (lang_add_fill): Likewise. (lang_leave_output_section_statement): Likewise. (lang_leave_overlay_section): Likewise. (lang_leave_overlay): Likewise. Adjust all callers of the above function. * ldlex.l: Include ldgram.h after ldexp.h. Allow hex numbers starting with "0X" as well as "0x". Return bigint.str for hex numbers starting with "0x" or "0X", zero bigint.str otherwise. Always use base 16 for numbers starting with "$". * ldmain.c: Include ldgram.h after ldexp.h. * ldwrite.c (build_link_order): Use bfd_data_link_order in place of bfd_fill_link_order. * pe-dll.c: Adjust lang_do_assignments calls. * emultempl/elf32.em: Likewise. * emultempl/hppaelf.em: Likewise. * emultempl/ppc64elf.em: Likewise. * emultempl/beos.em: Include ldgram.h after ldexp.h, adjust lang_add_assignment call. * emultempl/pe.em: Likewise.
* 2002-02-10 Daniel Jacobowitz <drow@mvista.com>Daniel Jacobowitz2002-02-101-1/+4
| | | | | | | * ldmain.c: Add prototype for main (). * lexsup.c: Guard declaration of strtoul with HAVE_STDLIB_H. * emultempl/lnk960.em (lnk960_choose_target): Function should take two arguments.
* * ldmain.c (main): Use full sentences to ease translation.Alan Modra2002-01-261-3/+5
|
* * ldmain.c (main): Initialise link_info.eh_frame_hdr.Alan Modra2001-12-141-0/+1
|
* Fixes to improve the ability to translate messages in the binutils toolsNick Clifton2001-12-061-2/+1
|
* Pass argc and argv to ldemul_choose_target.Tom Rix2001-12-031-1/+1
| | | | Support -b64 in AIX
* * ldgram.y (mri_script_command): Surround processing of INCLUDEAlan Modra2001-10-201-0/+7
| | | | | | | | | | | with ldlex_script, ldlex_popstate. (ifile_p1): Likewise. * ldlex.l (EOF): Don't BEGIN(SCRIPT). Restore lineno from the correct slot. (lex_push_file): Save current lineno to lineno_stack. Set lineno to 1. Don't BEGIN(SCRIPT). (lex_redirect): Similarly. * ldmain.c (main): Set yydebug non-zero if YYDEBUG.
* 2001-10-18 Chris Demetriou <cgd@broadcom.com>Chris Demetriou2001-10-181-1/+1
| | | | | * ldmain.c (get_emulation): Improve comment about the handling of -mipsN options.
* From John Reiser <jreiser@BitWagon.com>Alan Modra2001-09-291-0/+1
| | | | | | | | | | * ldlang.c (lang_common): Conditionally inhibit Common allocation. * lexsup.c: Add --no-define-common commandline option. * ldgram.y: Add INHIBIT_COMMON_ALLOCATION script command. * ldlex.l: Likewise. * ld.h: Add command_line.inhibit_common_definition. * ldmain.c (main): Initialize. * ld.texinfo: Document.
* Locale changes from Bruno Haible <haible@clisp.cons.org>.H.J. Lu2001-09-191-4/+7
|
* * ldmain.c (main): Rename BufferSize to ld_bufsz because HPUXAlan Modra2001-09-161-3/+3
| | | | defines BufferSize. Increase buffer size by one.
* 2001-08-31 Eric Christopher <echristo@redhat.com>Eric Christopher2001-08-311-0/+2
| | | | | | Jason Eckhardt <jle@redhat.com> * ldmain.c (get_emulation): Add support for -mips32 and -mips64.
* omitted in previous deltaNick Clifton2001-08-301-3/+3
|
* Declare BSIZE as staticNick Clifton2001-08-271-1/+1
|
* * elf-bfd.h (enum elf_reloc_type_class): New.Jakub Jelinek2001-08-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (struct elf_backend_data): Add elf_backend_reloc_type_class. (_bfd_elf_reloc_type_class): New. * elfxx-target.h (elf_backend_reloc_type_class): Define. (elfNN_bed): Add elf_backend_reloc_type_class. * elf.c (_bfd_elf_reloc_type_class): New. * elf32-i386.c (elf_i386_check_relocs): Set DF_TEXTREL if the reloc is against read-only section. (elf_i386_size_dynamic_sections): Use DF_TEXTREL flag instead of looking up section names for DT_TEXTREL. (elf_i386_reloc_type_class): New. (elf_backend_reloc_type_class): Define. * elf32-sparc.c (elf32_sparc_check_relocs): Set DF_TEXTREL if the reloc is against read-only section. (elf32_sparc_size_dynamic_sections): Use DF_TEXTREL flag instead of looking up section names for DT_TEXTREL. (elf32_sparc_reloc_type_class): New. (elf_backend_reloc_type_class): Define. * elf64-sparc.c (sparc64_elf_check_relocs): Set DF_TEXTREL if the reloc is against read-only section. (sparc64_elf_size_dynamic_sections): Use DF_TEXTREL flag instead of looking up section names for DT_TEXTREL. (sparc64_elf_reloc_type_class): New. (elf_backend_reloc_type_class): Define. * elfxx-ia64.c (struct elfNN_ia64_link_hash_table): Add reltext field. (elfNN_ia64_hash_table_create): Clear ia64_info. (get_reloc_section): Set DF_TEXTREL if the reloc is against read-only section. (elfNN_ia64_size_dynamic_sections): Use ia64_info->reltext flag instead of looking up section names for DT_TEXTREL. (elfNN_ia64_reloc_type_class): New. (elf_backend_reloc_type_class): Define. * elflink.h (size_dynamic_sections): Add spare DT_NULL tags. (struct elf_link_sort_rela): New. (elf_link_sort_cmp1, elf_link_sort_cmp2, elf_link_sort_relocs): New. (elf_bfd_final_link): Call elf_link_sort_relocs. Convert one spare DT_NULL into DT_RELCOUNT resp. DT_RELACOUNT if necessary. * bfdlink.h (struct bfd_link_info): Add combreloc and spare_dynamic_tags fields. * emultempl/elf32.em (place_orphan): Place orphan .rel* sections into .rel.dyn resp. .rela.dyn if combreloc. (get_script): If .x linker script is equal to .xn, only put it once into the binary. Add .xc and .xsc scripts. (parse_args): Handle -z combreloc and -z nocombreloc. * scripttempl/elf.sc (.rela.sbss): Fix a typo. For .xc and .xsc scripts put all .rel* or .rela* input sections but .rel*.plt and PLT-like sections into .rel.dyn resp. .rela.dyn. * genscripts.sh (GENERATE_COMBRELOC_SCRIPT): Set if SCRIPT_NAME is elf. Strip trailing whitespace from script. Generate .xc and .xsc scripts if requested. * ldmain.c (main): Initialize link_info.combreloc and link_info.spare_dynamic_tags. * lexsup.c (OPTION_SPARE_DYNAMIC_TAGS): Define. (ld_options): Add --spare-dynamic-tags option. (parse_args): Likewise. * ld.texinfo: Document -z combreloc and -z nocombreloc. * ldint.texinfo: Document .xc and .xsc linker scripts. * NEWS: Add notes about -z combreloc and SHF_MERGE.
* Fix for ldTom Rix2001-08-151-1/+1
|
* Make --verbose always display linker scriptNick Clifton2001-08-121-11/+36
|
* 2001-08-02 Charles Wilson <cwilson@ece.gatech.edu>Charles Wilson2001-08-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ldmain.c (main): initialize link_info.pei386_auto_import * pe-dll.c: new tables for auto-export filtering (auto_export): change API, pass abfd for contextual filtering. Loop thru tables of excluded symbols instead of comparing "by hand". 2001-08-02 Paul Sokolovsky <paul.sokolovsky@technologist.com> * pe-dll.c: new variable pe_dll_enable_extra_debug. New static variable current_sec (static struct sec *). Add forward declaration for add_bfd_to_link. (process_def_file): Don't export undefined symbols. Do not export symbols starting with "_imp__". Call auto_export() with new API. (pe_walk_relocs_of_symbol): New function. (generate_reloc): add optional extra debugging (pe_dll_generate_def_file): eliminate extraneous initial blank line in output (make_one): enlarge symtab to make room for __nm__ symbols (DATA auto-import support). (make_singleton_name_thunk): New function. (make_import_fixup_mark): New function. (make_import_fixup_entry): New function. (pe_create_import_fixup): New function. (add_bfd_to_link): Specify that 'name' argument is a CONST char *. * pe-dll.h: declare new variable pe_dll_extra_pe_debug; declare new functions pe_walk_relocs_of_symbol and pe_create_import_fixup. * emultempl/pe.em: add new options --enable-auto-import, --disable-auto-import, and --enable-extra-pe-debug. (make_import_fixup): New function. (pe_find_data_imports): New function. (pr_sym): New function. (gld_${EMULATION_NAME}_after_open): Add optional extra pe debugging. Call pe_find_data_imports. Mark .idata as DATA, not CODE. 2001-08-02 Charles Wilson <cwilson@ece.gatech.edu> * ld.texinfo: add additional documentation for --export-all-symbols. Document --out-implib, --enable-auto-image-base, --disable-auto-image-base, --dll-search-prefix, --enable-auto-import, and --disable-auto-import. * ldint.texinfo: Add detailed documentation on auto-import implementation.
* 2001-07-11 H.J. Lu <hjl@gnu.org>H.J. Lu2001-07-111-2/+2
| | | | * ldmain.c (main): Fix typos in the last change.
* 2001-07-11 Jakub Jelinek <jakub@redhat.com>Jakub Jelinek2001-07-111-0/+8
| | | | * ldmain.c (main): Disallow -F and -f without -shared.
* * lexsup.c (parse_args) <case OPTION_EXPORT_DYNAMIC, case 'E'>:Hans-Peter Nilsson2001-06-151-0/+1
| | | | | Set new link_info member export_dynamic. * ldmain.c (main): Initialize new link_info member export_dynamic.
* Add MIPS r12k supportNick Clifton2001-05-231-1/+2
|
* 2001-05-02 H.J. Lu <hjl@gnu.org>H.J. Lu2001-05-021-1/+1
| | | | | | | | | | | | | | | | * ldfile.c: Include "libiberty.h". * ldlex.l: Likewise. * ldmisc.c (buystring): Removed. * ldmisc.h: Likewise. * ldfile.c: Replace buystring with xstrdup. * ldlang.c: Likewise. * ldlex.l: Likewise. * ldmain.c: Likewise. * ldmisc.c: Likewise. * lexsup.c: Likewise. * mpw-eppcmac.c: Likewise.
* bfd/Jakub Jelinek2001-04-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libbfd-in.h (_bfd_merge_section): New. (_bfd_write_merged_section): New. (_bfd_merged_section_offset): New. * libbfd.h: Rebuilt. * linker.c (_bfd_generic_link_output_symbols): Handle discard_sec_merge. * aoutx.h (aout_link_write_symbols): Likewise. * pdp11.c (aout_link_write_symbols): Likewise. * elflink.h (elf_link_add_object_symbols): Call _bfd_merge_section. (elf_bfd_final_link): Adjust global symbols pointing into SEC_MERGE sections. (elf_link_sec_merge_syms): New. (elf_link_input_bfd): Call _bfd_merged_section_offset and _bfd_write_merged_section. Handle discard_sec_merge. * elf-bfd.h (struct elf_link_hash_table): Add merge_info field. (struct bfd_elf_section_data): Likewise. * elf.c (_bfd_elf_make_section_from_shdr): Set SEC_MERGE and SEC_STRINGS section flags and entsize from their ELF counterparts. (_bfd_elf_link_hash_table_init): Initialize merge_info. (elf_fake_sections): Set SHF_MERGE, SHF_STRINGS and sh_entsize from their BFD counterparts. * merge.c: New file. * Makefile.am: Add strtab.lo. * Makefile.in: Rebuilt. include/ * bfdlink.h (bfd_link_discard): Add discard_sec_merge. gas/ * config/obj-elf.c (obj_elf_change_section): Add entsize argument, handle SHF_MERGE and SHF_STRINGS. (obj_elf_parse_section_letters): Set SHF_MERGE and SHF_STRINGS. (obj_elf_section): Allow additional argument specifying entity size. * write.c (adjust_reloc_syms): Keep relocations against local symbols in SEC_MERGE sections. ld/ * ldmain.c (main): Default to discard_sec_merge. * lexsup.c (OPTION_DISCARD_NONE): Define. (ld_options): Add --discard-none. (parse_args): Handle OPTION_DISCARD_NONE. * ldlang.c (wild_doit): SEC_MERGE should be set in the output section only if SEC_MERGE and SEC_STRINGS flags and entsize of all its input sections match.
* Fixtypos in ChangeLogs, fix copyright dates in filesNick Clifton2001-03-131-1/+1
|
* Add link option to allow undefiedn symbols in shared librariesNick Clifton2000-12-121-0/+1
|
* Remove redundant init of config.make_executable to true.Nick Clifton2000-11-241-1/+0
|
* 2000-10-09 Kazu Hirata <kazu@hxi.com>Kazu Hirata2000-10-091-2/+1
| | | | | | | | | | | | | | | * ldcref.c: Fix formatting. * ldctor.h: Likewise. * ldemul.c: Likewise. * ldemul.h: Likewise. * ldexp.c: Likewise. * ldexp.h: Likewise. * ldfile.c: Likewise. * ldfile.h: Likewise. * ld.h: Likewise. * ldlang.c: Likewise. * ldlang.h: Likewise. * ldmain.c: Likewise.
* 2000-09-21 Kazu Hirata <kazu@hxi.com>Kazu Hirata2000-09-211-30/+21
| | | | | | | * ldmain.c: Fix formatting. * ldmisc.c: Likewise. * ldver.c: Likewise. * ldwrite.c: Likewise.
* Disable relaxation if multiple symbol definitions are encountered - otherwiseNick Clifton2000-09-141-0/+7
| | | | the linker could abort with an assertion failure.
* --split-by-reloc, --split-by-file extensions. --unique option.Alan Modra2000-09-051-0/+2
|
* 2000-07-20 H.J. Lu <hjl@gnu.org>H.J. Lu2000-07-201-0/+1
| | | | | | | | | | | * ld.texinfo: Add documentation for --disable-new-dtags and --enable-new-dtags. * ldmain.c (main): Initialize link_info.new_dtags to false. * emultempl/elf32.em (gld_${EMULATION_NAME}_parse_args): Add --disable-new-dtags and --enable-new-dtags. (gld_${EMULATION_NAME}_list_options): Likewise.
* 2000-07-19 H.J. Lu <hjl@gnu.org>H.J. Lu2000-07-201-0/+2
| | | | | | | | | | | | | | | | | | | | * emulparams/elf32mcore.sh (PARSE_AND_LIST_ARGS): Removed. (PARSE_AND_LIST_PROLOGUE): New. (PARSE_AND_LIST_LONGOPTS): Likewise. (PARSE_AND_LIST_OPTIONS): Likewise. (PARSE_AND_LIST_ARGS_CASES): Likewise. * ldmain.c (main): Clear link_info.flags and link_info.flags_1. * lexsup.c (ld_options): Comment out 'z'. (parse_args): Likewise. * emultempl/elf32.em: Include "elf/common.h". (gld_${EMULATION_NAME}_parse_args): Defined. Handle some -z options. (gld_${EMULATION_NAME}_list_options): Likewise. * ld.texinfo: Add documentation for the recognized -z options.
* Remove some forward declarations in ldemul.h and ldfile.h, andAlan Modra2000-07-111-1/+1
| | | | | | re-arrange header include order. Fix shadowing warnings in ldlang.h Fix compile errors in mpw-elfmips.c
* Correct pointer comparisons relying on NULL less than any other pointer.Alan Modra2000-06-201-1/+1
| | | | Alexander Aganichev's fix for ieee.c
* Correctly set SEC_READONLY for .text section.Alan Modra2000-06-151-11/+12
|
* Eli Zaretskii's DOSish file name patches.Alan Modra2000-05-261-1/+10
|
* When deciding if ".text" section should be read-only, don't forget to resetNick Clifton2000-05-231-10/+11
| | | | SEC_READONLY because it could be already set.
* Apply patch from Richard Gorton <gorton@scrugs.lkg.dec.com> to implementNick Clifton2000-05-171-1/+2
| | | | --emit-relocs switch to the linker to preserve relocs in an output executable
* 2000-03-01 H.J. Lu <hjl@gnu.org>H.J. Lu2000-03-011-6/+15
| | | | | | * ldmain.c (undefined_symbol): Take one more arg, fatal, to indicate if the undefined symbol is a fatal error or not. Don't delete the output file if "fatal" is false.
* * Many files: Changes to avoid gcc warnings: Add ATTRIBUTE_UNUSEDIan Lance Taylor1999-07-111-9/+9
| | | | as appropriate. Fill in structure initializations.
* * ldmain.c (main): Initialize link_info.init_function andMark Mitchell1999-06-231-1/+5
| | | | | | | | link_info.fini_function. * lexsup.c (OPTION_INIT): New macro. (OPTION_FINI): Likewise. (ld_options): Add descriptions for them. (parse_args): Handle them.
* Initial revisionRichard Henderson1999-05-031-0/+1300