bfd_check_format_matches, and, if ambiguous, print a list of
matching formats. If file format is not recognized, treat file as
a linker script.
* ldgram.y (yyerror): If assuming an object file is a script,
mention that. Tweak the format of the error messages.
* ldlex.l (lex_warn_invalid): If assuming an object is a script,
guess that this is not actually a script, and just report that the
file format was not recognized.
* ld.texinfo (Options): Admit that -( may be used more than once.
Add note that unrecognized object files are now treated as linker
scripts.
* ldfile.c (ldfile_input_filename): Make const.
(ldfile_assumed_script): New variable.
(try_open): Change arguments types to const.
(ldfile_find_command_file): Likewise.
(ldfile_open_command_file): Likewise. Also, set lineno to 1.
* ldfile.h: Update declarations for ldfile.c changes.
* ldlex.l: Include <ctype.h>.
(file_name_stack): Change to be const char *.
(lineno_stack): New static variable.
(<<EOF>>): Set lineno as well as ldfile_input_filename.
(lex_push_file): Make name argument const. Initialize
lineno_stack entry.
(lex_redirect): Initialize lineno_stack entry.
(lex_warn_invalid): Handle non printable characters nicely.
* ldlex.h (lex_push_file): Declare second argument as const.
* ldgram.y (ifile_p1): Recognize GROUP.
* ldlex.l: Recognize GROUP.
* ld.texinfo (Option Commands): Document GROUP.
lang_one_common as power of two.
(lang_one_common): Get common symbol alignment from linker hash
table entry. Treat desired alignment as a power of two.
* 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.
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.
* ldlang.c (out_bfd_get_section_by_name): Remove.
(wild_section): Call bfd_get_section_by_name rather than
our_bfd_get_section_by_name. Don't call wild_doit if there is no
section.
(lang_create_output_section_statements): Remove.
(map_input_to_output_sections): For several cases, call init_os if
it has not already been called.
(lang_size_sections): If output section was not created, skip it.
(lang_process): Don't call lan_create_output_section_statements.
(lang_place_orphans): Skip files with just_syms_flags set to true.
* ld.texinfo: Document change.
real to true for lang_input_file_is_marker_enum. Clear the_bfd.
(lang_add_input_file): Pass true to new_afile for add_to_list.
(lookup_name): Remove force_load argument. Changed all callers.
Pass false to new_afile for add_to_list. Split loading of symbols
out into separate function.
(load_symbols): New function split out of lookup_name. Don't load
the symbols if they are already loaded.
(open_input_bfds): For lang_input_statement_enum call load_symbols
rather than lookup_name.
(lang_process): Pass abs_output_section rather than NULL to
lang_size_sections.
(lang_startup): Set real field of first_file to true.
* ldmain.c (add_to_set): Now takes reloc argument rather than
bitsize. Check config.build_constructors here. If an new hash
table entry is created, mark it as undefined.
(constructor_callback): No longer takes bitsize argument. Pass
BFD_RELOC_CTOR to ldctor_add_set_entry, but first make sure the
BFD backend supports it.
(reloc_overflow): Handle a NULL abfd argument.
(reloc_dangerous, unattached_reloc): Likewise.
* ldctor.c: Include ldmain.h.
(struct set_info): Change bitsize field to reloc.
(ldctor_add_set_entry): Now takes reloc argument rather than
bitsize. Don't bother to check config.build_constructors here.
(ldctor_build_sets): Get the size from the reloc howto. If
generating relocateable output, call lang_add_reloc rather than
lang_add_data.
* ldctor.h (ldctor_add_set_entry): Change declaration to use reloc
instead of bitsize.
* ldlang.h (statement_enum): Add lang_reloc_statement_enum.
(lang_reloc_statement_type): New structure.
(lang_statement_union_type): Add reloc_statement field.
(lang_add_reloc): Declare new function.
* ldlang.c (lang_for_each_statement_worker): Handle
lang_reloc_statement_enum.
(map_input_to_output_sections, print_statement): Likewise.
(lang_size_sections, lang_do_assignments): Likewise.
(print_reloc_statement): New function.
(lang_add_reloc): New function.
* ldwrite.c (build_link_order): Handle lang_reloc_statement_enum.
Just use map_file or map_filename instead.
(add_archive_element): Use minfo to write map information, not
info_msg.
(constructor_callback): Use fprintf to write map information, not
info_msg.
* ldmain.h (write_map): Don't declare.
* ldgram.y (mri_script_command): Removed reference to write_map.
* ldlang.c (lang_one_common): Likewise.
* lexsup.c (parse_args): Likewise.
it via hppaelf_finish). Prototype moved into ldlang.h.
(lang_process): Move problematic extra call to lang_size_sections
into the PA ELF specific code.
* emultempl/hppaelf.em (hppaelf_finish): Extra call to
lang_size_sections moved here.
(lang_size_sections): If the canonical symbols have not already
been read in, read them in before relaxing.
* ldlang.h (relaxing): Removed declaration.
INPUT(), then change the file type to lang_input_file_is_l_enum.
* ldgram.y: In input_list, change lang_input_file_is_file_enum to
lang_input_file_is_search_file_enum so objects brought in using
INPUT() do a path lookup.
* 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.
It wasn't documented (or likely used) and wastes time.
(try_open): If EXTEN is empty, don't try it.
* ldctor.c, lderror.c, ldexp.c, ldfile.c, ldindr.c, ldlang.c,
ldlex.l, ldmain.c, ldmisc.c, ldsym.c, ldver.c, ldwarn.c,
ldwrite.c, lexsup.c, mri.c, relax.c: Replace DEFUN macro calls
with normal function declarations.
* Move *.em to emultempl/*.em. Move *.sh to emulparams/*.sh.
Move *.sc-sh to scripttempl/*.sc.
* {emultempl,emulparams,scripttempl}/README: New files.
* sh.em, st2000.em, z8ksim.em, h8300hms.em, h8500hms.em: Files
removed, replaced with generic.em.
* h8300.sh, h8500.sh, h8300.sc, h8500.sc: Renamed from
h8[35]00hms.s[ch]. Change their contents to omit the "hms".
* *.em (*_get_script): Return script name instead of script contents.
* ldlang.c (lang_process): Change caller.
* ldlex.l, ldgram.y: Recognize -m option.
Check for input files after *all* options in grammar.
* ldmain.c (main): Check for -m options. Add default directory
for -m.
* mkscript.c: File removed.
* genscripts.sh: Take two more parameters, tooldirlib and libdir,
to add to the default LIB_PATH.
Look for input files in the new subdirectories.
Create the scripts in emulations subdirectory and don't filter
them through mkscript.
* configure.in: Make the emulations subdirectory.
* Makefile.in: Account for all of the above changes.
Remove unused .SUFFIXES. Get libgcc.a path with gcc
-print-libgcc-file-name instead of $(libdir)/libgcc.a.
Put CFLAGS last in the compilation rules.
Add -I../bfd to INCLUDES so sysdep.h is found.
* ldfile.c (try_open): If opening without the extension fails,
try with the extension even if -v or -V was given.
had_script is imported (from ldgram.y), not exported.