* ldmain.c (main): Initialize link_info.wrap_hash.
* ldexp.c (fold_name): Use bfd_wrapped_link_hash_lookup in DEFINED
and NAME cases.
* ld.texinfo, ld.1: Document --wrap.
* 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.
* 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.
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.
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.
* 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.
* 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.
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.
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.
* 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.
* 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.
(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.
* 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.
* 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.
* 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.
* 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