aboutsummaryrefslogtreecommitdiff
path: root/ld/ldmain.c
AgeCommit message (Collapse)AuthorFilesLines
1995-07-10 Based on patches from H.J. Lu <hjl@nynexst.com>:Ian Lance Taylor1-2/+0
* ldlang.h (lang_input_statement_type): Add new field dynamic. * ldlang.c (new_afile): Set dynamic from config.dynamic_link. * ldfile.c: Include bfdlink.h. (ldfile_open_file): Check dynamic field of entry, not global dynamic_link field. Don't do a dynamic search when doing a relocateable link. * ldmain.c (main): Don't warn about dynamic_link for a relocateable link. * emultempl/sunos.em (gld${EMULATION_NAME}_find_so): Skip file if dynamic is false. (gld${EMULATION_NAME}_create_output_section_statements): Always loop over input files. * Makefile.in: Rebuild dependencies.
1995-07-10 * ld.texinfo, ld.1: Document -Bstatic, -Bdynamic, -Bshared, andIan Lance Taylor1-0/+1
-shared. Mon Jul 10 13:29:43 1995 Eric Youngdale <eric@aib.com> * ldmain.c (main): Set link_info.symbolic to false. * lexsup.c (parse_args): Handle -Bsymbolic.
1995-07-07fsf address update, but not in COPYING filesKen Raeburn1-1/+1
1995-07-05 * ldmain.c (HAVE_SBRK): Define for everything exceptFred Fish1-2/+7
specific systems that are known to not support sbrk. (main): Use HAVE_SBRK to decide whether or not to use sbrk.
1995-06-29Wed Jun 28 17:11:25 1995 Steve Chamberlain <sac@slash.cygnus.com>Steve Chamberlain1-0/+13
* ldmain.c (main): Always initialize PE info in link_info. * lexsup.c (OPTION_BASE_FILE): New option. (parse_args): Handle new option. * emulparams/armpe.sh: Output pei. * emultempl/i386pe.em: Add newline to end. * scripttempl/armpe.sc: Change output and quote the $s. * scripttempl/i386pe.sc: Change output and quote the $s.
1995-03-27 * ldmain.c (main): Revert patch of March 10, since the SVR4 linkerIan Lance Taylor1-1/+6
does mark shared libraries as executable.
1995-03-16 * ldlang.c (load_symbols): If whole_archive is true and ENTRYIan Lance Taylor1-0/+4
describes an archive, call bfd_link_add_symbols on each member. * ldmain.c (whole_archive): New variable. (main): Initialize it to false. * ldmain.h: Declare whole_archive. * lexsup.c (parse_args): Grok --whole-archive switch.
1995-03-10 * ldmain.c (main): Don't set EXEC_P if link_info.shared is set.Ian Lance Taylor1-2/+11
1995-02-06 * ldmain.c (undefined_symbol): Handle section being NULL.Ian Lance Taylor1-6/+18
1995-02-06 * ldctor.c (ldctor_build_sets): Handle bfd_link_hah_defweak.Ian Lance Taylor1-9/+26
* ldexp.c (fold_name): Likewise. * ldlang.c (print_one_symbol): Likewise. (lang_finish): Likewise. * ldmain.c (multiple_common): Likewise. * ldwrite.c (print_symbol): Likewise. Also, bfd_link_hash_weak renamed to bfd_link_hash_undefweak.
1994-09-14 * ld.h (ld_config_type): Add new field warn_once.Ian Lance Taylor1-0/+21
* ldmain.c (undefined_symbol): Handle -warn-once. * lexsup.c (parse_args): Recognize -warn-once. * ld.texinfo (Options): Document -warn-once. * ld.1: Likewise. PR 4456.
1994-09-14 * ldmisc.c (vfinfo): Handle %D as %C, but never print the functionIan Lance Taylor1-3/+4
name. For %C, print the function name on a separate line, to keep the length of error messages under control. * ldmain.c (multiple_definition): Use %D for ``first defined here.'' (undefined_symbol): Use %D for ``more undefined references follow''. PR 3770.
1994-06-16 * lexsup.c (parse_args): Add -shared to longopts, and handle it.Ian Lance Taylor1-0/+3
* ldmain.c (main): Initialize link_info.shared to false. Give error if link_info.relocateable and link_info.shared are both set.
1994-06-15 * ldmain.c (get_emulation): Ignore -m486 for Linux compatibility.Ian Lance Taylor1-0/+6
* lexsup.c (parse_args): Ignore -qmagic for Linux compatibility.
1994-06-15 Let the user change the dynamic linker used by ELF code.Ian Lance Taylor1-0/+1
* ld.h (args_type): Add new field interpreter. * lexsup.c (parse_args): Add dynamic-linker to longopts, and handle it. * ldmain.c (main): Initialize command_line.interpreter to NULL. * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Get the ELF backend to return the .interp section. If command_line.interpreter is not NULL, set the contents of .interp to it. * ld.texinfo: Mention -dynamic-linker.
1994-06-15 * ld.h (ld_config_type): Add new field traditional_format.Ian Lance Taylor1-0/+1
* lexsup.c (parse_args): Add traditional_format to longopts, and handle it. * ldmain.c (main): Initialize config.traditional_format to false. * ldlang.c (ldlang_open_output): Set BFD_TRADITIONAL_FORMAT in BFD flags of output_bfd according to config.traditional_format. * ld.texinfo: Document -traditional-format.
1994-06-02 * ldfile.h (search_dirs_type): Move from ldfile.c, and add cmdlineIan Lance Taylor1-1/+1
field. (search_head): Declare. (ldfile_add_library_path): Add new cmdline argument in prototype. * ldfile.c (search_head): Make non-static. (search_dirs_type): Move to ldfile.h. (ldfile_add_library_path): Accept cmdline argument, and save it. * lexsup.c (parse_args): Pass true for new cmdline argument of ldfile_add_library_path. (set_default_dirlist): Likewise. * ldmain.c (check_for_scripts_dir): Pass false for new cmdline argument of ldfile_add_library_path. * ldgram.y (ifile_p1): Likewise.
1994-06-01 * ldlang.h (lang_input_statement_type): Remove fields subfiles,Ian Lance Taylor1-11/+6
total_size, superfile and chain. * ldfile.c (open_a): Don't clear search_dirs_flag. (ldfile_open_file): Don't try to open superfile. Assert that file has not already been opened. * ldlang.c (new_afile): Don't initialize superfile. * ldmain.c (add_archive_element): Don't initialize subfiles or chain or superfile. Initialize search_dirs_flag to false.
1994-05-19 Add support for ELF shared libraries.Ian Lance Taylor1-26/+57
* ld.h (ld_config_type): Add field dynamic_link. * ldmain.c (main): Initialize config.dynamic_link to false. Warn on attempts to use -r with -relax, -call_shared or -s. * lexsup.c (longopts): Separate OPTION_CALL_SHARED from OPTION_NON_SHARED. Add OPTION_IGNORE. Adjust macro values accordingly. Add "dy" and "non_shared" options. Change "Qy" to OPTION_IGNORE for now. Handle OPTION_CALL_SHARED and OPTION_NON_SHARED by setting dynamic_link field accordingly. Handle OPTION_IGNORE by ignoring it. Clear dynamic_link field for -r and -Ur. * ldfile.c (ldfile_open_file): If config.dynamic_link is true, try opening a file with a .so extension first. * emultempl/elf32.em: New file. * emulparams/elf32_sparc.sh (TEXT_START_ADDR): Change to 0x10000. (NONPAGED_TEXT_START_ADDR): Likewise. (TEMPLATE_NAME): Define as elf32. (DATA_PLT): Define. * emulparams/elf_i386.sh (TEMPLATE_NAME): Define as elf32. * scripttempl/elf.sc: Add placement for new dynamic sections. Don't use CREATE_OBJECT_SYMBOLS. Define _etext, _edata and _end outside of any section. Don't use ALIGN(8); just let one section VMA follow another. Put .dynbss in .bss. Don't mention debugging sections; they'll be handled correctly anyhow. * Makefile.in (eelf_i386.c): Depend upon elf32.em, not generic.em.
1994-02-25 Use getopt instead of lex and yacc to parse the command line.David MacKenzie1-9/+5
* ld.texinfo (Options): Document changes to option syntax. * Makefile.in: Update dependencies. * ldver.c (help): Tweak dashes in usage message. * ldgram.y (%union): Remove unused members. Remove %tokens for command line options; add ones for input types. (command_line): Rules removed. (file): Instead of command line, recognize an input type indicator, then use the nonterminal for that type. (defsym_expr): New nonterminal from code formerly in command_line. * ldlex.h: Declare parser input type enum and variable. Don't declare parse_line. * ldlex.l: Remove unused variables. Make some used ones static and comment them. (COMMAND): Start state and its rules removed. At start of yylex, return input state token if at start of input. (lex_redirect): Don't need to set yyout. (ldlex_command): Function removed. * ldmain.c (main): Instead of calling parse_line, set up the redirections and call yyparse directly. * ldmisc.c (vfinfo): If there's no input filename, print nothing, not "command line". * lexsup.c: Remove #if 0'd code. (parse_line): Function removed. (parse_args): Rewrite to use getopt_long_only. (set_default_dirlist): New function from code formerly in ldgram.y:command_line. (set_section_start): New function. * emultempl/generic.em, emultempl/gld960.em, emultempl/hppaelf.em, emultempl/lnk960.em, emultempl/m88kbcs.em: Don't enclose compiled-in link scripts in "{" and "}", as the grammar no longer wants them to be.
1994-02-17 * ldlang.c, ldmain.c, ldmisc.c: Use bfd_get_error andDavid MacKenzie1-3/+4
bfd_set_error and new error names.
1994-02-05 * emultempl/lnk960.em (append), emultempl/hppaosf.emDavid MacKenzie1-10/+3
(hppaosf_finish): Call xmalloc, not ldmalloc. * ldmain.c (preserve_output): Function removed. (main): Do it here instead.
1994-02-05 * ldmisc.c (ldmalloc, xmalloc, ldrealloc, xrealloc): FunctionsDavid MacKenzie1-14/+36
deleted; will use libiberty versions instead. * ldctor.c ldfile.c ldlang.c ldmain.c ldmisc.c ldmisc.h lexsup.c mri.c Makefile.in: Change callers. * ldmisc.c (vfinfo): Remove cleanup code. * ldmain.c (remove_output): Put it here (new function). (preserve_output): New function. (main): Register remove_output and preserve_output with atexit. * ldmain.c ldgram.y: Call xexit instead of exit. * ldmisc.h: Declare xexit.
1994-01-27 * ldmain.c ldmain.h ldgram.y: If -v -V or --version was given,David MacKenzie1-1/+7
exit successfully instead of complaining if no input files are given.
1994-01-25Tue Jan 25 13:19:41 1994 Stan Shebs (shebs@andros.cygnus.com)Stan Shebs1-1/+6
* ldmain.c (main): Compute and display total execution time. * ld.texinfo (-stats): Document the option.
1994-01-24 * ldmain.c (reloc_overflow): Added name, reloc_name and addendIan Lance Taylor1-4/+15
arguments.
1994-01-06 * ldmain.c (add_to_set): Add bitsize argument.Ian Lance Taylor1-843/+387
(constructor_callback): New function. (link_callbacks): Add constructor_callback. * ldctor.c (struct set_info): Add bitsize field. (ldctor_add_set_entry): Add bitsize argument. (ldctor_build_sets): Base the size of the elements of the set on the bitsize, rather than always using LONG. * ldctor.h (ldctor_add_set_entry): Add bitsize to declaration.
1993-12-12More gcc lint.Ian Lance Taylor1-45/+66
1993-12-11 Made many changes to eliminate gcc warnings. Made variousIan Lance Taylor1-10/+16
cosmetic changes, declared various things in header files, removed various extern declarations from .c files. No substantive changes.
1993-11-19 * ldmain.c (enter_file_symbols): Removed duplicate tests of p. IfIan Lance Taylor1-44/+98
p is in a common section, make sure the BFD has a section of that name.
1993-08-03add -warn-common optionDavid MacKenzie1-35/+55
1993-07-15remove dupliate includeDavid MacKenzie1-1/+1
1993-07-15source cleanups; fix finding scriptsDavid MacKenzie1-47/+54
1993-07-15 * ldfile.c (ldlang_open_file, ldfile_open_command_file),David MacKenzie1-1/+1
main.c (main): Print the errno string in the error message.
1993-07-13 * ldmain.c (set_scripts_dir): Check . and <ld bin dir>/../lib forDavid MacKenzie1-14/+30
ldscripts, as well as <ld bin dir> and SCRIPTDIR.
1993-07-12 * ldlang.c (lang_process): Use sizeof instead of magic constant.David MacKenzie1-54/+121
* ldmain.c (get_emulation, check_for_scripts_dir, set_scripts_dir): New functions. (main): Call them.
1993-07-03 Fix previous fix.David MacKenzie1-0/+5
1993-07-03 * ldmain.c (main): Don't add scriptdir to the lib search path.David MacKenzie1-24/+51
* genscripts.sh: Put the scripts in the ldscripts directory, not emulations. * configure.in (ldscripts): Make, instead of emulations. * Makefile.in (scriptdir): Take off the "ld" part. (install, clean, distclean): Use ldscripts, not emulations. In tests, pass -L., not -Lemulations. (ldmain.o): Don't pass -DSCRIPTDIR=.... * ldlang.c (lang_process): Add "ldscripts/" to the name of the default script file.
1993-03-30Tue Mar 30 09:40:25 1993 Steve Chamberlain (sac@thepub.cygnus.com)Steve Chamberlain1-230/+229
* ldindr.c (add_indirect): Keep more information in the alias symbol chain. * ldlang.c (wild_doit): Don't inherit NEVER_LOAD section attribute from an input section. * ldmain.c (Q_enter_file_symbols): Common section is NEVER_LOAD by default. (Q_enter_file_symbos): Indirect symbols now are known by their section, not a special symbol flag. * ldsym.c (write_file_locals): Indirect symbols aren't local. (write_file_globals): Write the mapping for an indirect symbol. * relax.c (build_it): When forced to write a NEVER_LOAD section, fill it with zeros.
1993-01-29Fri Jan 29 09:57:58 1993 Ian Lance Taylor (ian@cygnus.com)Ian Lance Taylor1-5/+10
* ldmain.c (subfile_wanted_p): If we already have a common definition of a symbol, don't necessarily pull in an object file that provides a non-common definition.
1993-01-26Tue Jan 26 11:49:50 1993 Ian Lance Taylor (ian@cygnus.com)Ian Lance Taylor1-61/+114
* ldmain.c, ldsym.c: Use new bfd_is_com_section macro rather than checking for equality to bfd_com_section.
1992-10-05Mon Oct 5 08:55:14 1992 Steve Chamberlain (sac@thepub.cygnus.com)Steve Chamberlain1-58/+59
* ldmain.c (linear_library): don't even think about processing an object file if it's already been done
1992-07-02Aliasing bug fixesSteve Chamberlain1-105/+115
1992-06-08*** empty log message ***Steve Chamberlain1-442/+507
1992-06-08*** empty log message ***Steve Chamberlain1-22/+32
1992-05-06 * ldfile.c: merge in VMS filename supportSteve Chamberlain1-13/+26
* ldmain.c (main): take out ./ from library path, and close file before unlinking. Make multiple defs of a symbol create an unexecable file. * ldmisc.c: fatal errosrs delete output file
1992-05-04 * ldver.c: Bumped version to 1.96 - new release, resync with theSteve Chamberlain1-7/+8
bfd too #. * ldexp.c, ldlang.c: now build memory shape tree in obstacks rather than with raw malloc, makes it easier to track where memory is going. * ldsym.h, ldsym.c: create obstack for all global symbols too. * ldwrite.c (ldwrite): moved malloc so only used when needed. * sa29200-sc.sh: added support for .lit, data1 and data2 sections.
1992-04-05New lexer.Steve Chamberlain1-2/+10
New targets for h8/300 simulator and DOS
1992-03-06 * ldmain.c (Q_enter_file_symbols): now aliases work againSteve Chamberlain1-23/+26
1992-01-28 * ldgram.y: map -M behave in the same way as -Map (sets file nameSteve Chamberlain1-40/+47
to be "-". * ldsym.c, ldlang.c: remember that size of a section is dependent on whether or not relaxing has been done. * ldmain.c: don't open a map file if it doesn't have a name * relax.c: all the brains have moved into bfd. * ldwrite.c: ammend comment