aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.c
AgeCommit message (Collapse)AuthorFilesLines
1997-03-15Sat Mar 15 18:10:38 1997 H.J. Lu <hjl@lucon.org>Ian Lance Taylor1-14/+186
* ldemul.h (ldemul_list_emulations): Use full prototype. * ldlang.c (print_one_symbol): Add declaration. * ldlang.h (dprint_statements): Declare. * ldmain.c (remove_output): Declare. * ldmisc.c (vfinfo): Declare. * ldwrite.c (clone_section): Declare. (split_sections): Make static. Declare. * mri.c: Include libiberty.h. (strdup): Don't declare. (mri_alias): Use xstrdup rather than strdup.
1996-08-05 * ldlex.l: Recognize OVERLAY.Ian Lance Taylor1-20/+184
* ldgram.y: Add section_phdr field to %union. (section): Handle phdr_opt result. Add OVERLAY case. (opt_exp_without_type): New nonterminal. (phdr_opt): Return list of phdrs. (overlay_section): New nonterminal. * ldlang.c: Include <ctype.h>. (lang_leave_output_section_statement): Add phdrs parameter. Change all callers. (lang_section_in_phdr): Remove. (overlay_vma, overlay_lmn, overlay_max): New static variables. (struct overlay_list): Define. (overlay_list): New static variable. (lang_enter_overlay, lang_enter_overlay_section): New functions. (lang_leave_overlay_section, lang_leave_overlay): New functions. * ldlang.h (lang_leave_output_section_statement): Update declaration for new parameter. (lang_section_in_phdr): Don't declare. (lang_enter_overlay, lang_enter_overlay_section): Declare. (lang_leave_overlay_section, lang_leave_overlay): Declare. * ld.texinfo (Overlays): New node under SECTIONS, documenting overlays. * ldlex.l: Recognize MAX and MIN. * ldgram.y (MAX, MIN): New terminals. (exp): Recognize MAX and MIN. * ldexp.c (fold_binary): Handle MAX and MIN. * ld.texinfo (Arithmetic Functions): Document MAX and MIN. * ld.texinfo (PHDRS): Use @cindex, not @kindex, for program header index entries. * ldgram.y (SIZEOF, ADDR): Do not specify type.
1996-08-02 * ldgram.y (LOADADDR): New terminal.Ian Lance Taylor1-0/+1
(exp): Handle LOADADDR. * ldlex.l: Recognize LOADADDR. * ldexp.c (exp_print_token): Add LOADADDR. (fold_name): Implement LOADADDR. * ldlang.c (exp_init_os): Treat LOADADDR like ADDR. * ld.texinfo (Arithmetic Functions): Document LOADADDR.
1996-08-01 * ld.h (check_nocrossrefs): Declare.Ian Lance Taylor1-0/+18
* ldlang.h (struct lang_nocrossref): Define. (struct lang_nocrossrefs): Define. (nocrossref_list): Declare. (lang_add_nocrossref): Declare. * ldlex.l: Recognize NOCROSSREFS keyword. * ldgram.y (%union): Add nocrossref field. (NOCROSSREFS): New terminal. (ifile_p1): Recognize NOCROSSREFS. (nocrossref_list): New nonterminal. * ldlang.c (nocrossref_list): Define. (lang_add_nocrossref): New function. * ldmain.c (main): If nocrossref_list is not NULL, call check_nocrossrefs. (warning_callback): Free symbols if there is no place to store them. (notice): Call add_cref if nocrossref_list is not NULL. * ldcref.c: Include "ldexp.h" and "ldlang.h". (check_nocrossrefs): New function. (check_nocrossref): New static function. (struct check_refs_info): Define. (check_refs, check_reloc_refs): New static functions. * Makefile.in: Rebuild dependencies. * ld.texinfo (Option Commands): Document NOCROSSREFS.
1996-07-30 * ldlang.c (lang_size_sections): Add the section VMA to the resultIan Lance Taylor1-1/+1
value when computing the address of a section.
1996-07-29 * fnmatch.h, fnmatch.c: New files.Ian Lance Taylor1-62/+209
* ldlex.l: Remove unused definition of FILENAME. Add definition of WILDCHAR. In SCRIPT mode, accept any sequence of WILDCHAR as a NAME. * ldgram.y (file_NAME_list): Accept '*' and '?' specially. (input_section_spec): Accept '?' specially. (statement): Change exp to mustbe_exp in length and FILL cases. (section): Call ldlex_script before section statements, and call ldlex_popstate after them. * ldlang.c: Include "fnmatch.h". (wildcardp): New static function. (wild_section): Permit the section name to be a wildcard. (wild_file): New static function, broken out of wild. (wild): Call wild_file. Permit the file name to be a wildcard. (open_input_bfds): Don't call lookup_name for a wildcard pattern. * Makefile.in: Rebuild dependencies. (CFILES): Add fnmatch.c. (HFILES): Add fnmatch.h. (OFILES): Add fnmatch.o. * ld.texinfo: Document that file and section names can now be wildcard patterns. * ldlang.c (lang_place_orphans): Correct condition: place a common section if not relocateable or if common definitions are forced.
1996-05-02 * ldlang.c (section_already_linked): Fix typos.David Edelsohn1-3/+3
1996-04-29 * ldlang.c (longest_section_name): Remove.Ian Lance Taylor1-313/+246
(SECTION_NAME_MAP_LENGTH): Define. (print_size, print_alignment, print_fill, print_section): Remove. (print_flags): Remove. (lang_map): Rewrite. (print_output_section_statement): Rewrite. (print_assignment): Rewrite. (print_one_symbol): Rewrite. (print_input_section): Rewrite. (print_fill_statement): Rewrite. (print_data_statement): Rewrite. (print_address_statement): New static function. (print_reloc_statement): Rewrite. (print_padding_statement): Rewrite. (print_wild_statement): Rewrite. (print_statement_list): Clean up. (print_statement): Clean up. Some minor output changes. (print_statements): Clean up. (load_symbols): Put another - before -whole-archive. * ldexp.c (exp_print_tree): Change etree_value and etree_rel to print 0x and to omit leading zeroes. For etree_rel, use %B to print the BFD. For etree_assign, remove the space after the destination name. * ldwrite.c: Include "libiberty.h". (clone_section): Call xstrdup, not strdup. (ldwrite): Don't print any map information. (print_symbol_table, print_file_stuff, print_symbol): Remove. * ldmain.c (main): Call lang_map when appropriate. * ldmisc.c (vfinfo): Add support for %W. (print_address): Remove. * ldmisc.h (print_address): Don't declare. * Makefile.in: Rebuild dependencies.
1996-04-26 * ldmisc.h (demangle): Declare.Ian Lance Taylor1-3/+45
* ldmisc.c: Include "libiberty.h". Include demangle.h with "", not <>. (demangle): Make non-static. Remove remove_underscore paramter. Always return an allocated string. (vfinfo): Free result of demangle. Add case 'G'. Use %T to print functionname, rather than calling demangle. Print a colon between the BFD(section+offset) and the line number. * ldmain.c (add_archive_element): Improve format of archive information in map file. (constructor_callback): Don't print anything to the map file. * ldlang.c (lang_one_common): Improve format of common symbol information in map file. * ldctor.c (ldctor_build_sets): If producing a map file, print set information. * ldwrite.c (print_symbol_table): Print a newline before the header in the map file. * Makefile.in: Rebuild dependencies.
1996-04-22 * ldlang.c (lang_size_sections): If _cooked_size is not 0, thenIan Lance Taylor1-2/+5
don't clobber it when not relaxing. * ld.h (ld_config_type): Remove traditional_format field. * ldmain.c (main): Use link_info.traditional_format rather than config.traditional_format. * ldlang.c (ldlang_open_output): Likewise. * lexsup.c (parse_args): Likewise. * emultempl/aix.em (gld${EMULATION_NAME}_parse_args): Likewise. * mpw-eppcmac.c (gldppcmacos_parse_args): Likewise.
1996-04-22 * ldlang.c (wild_doit): Discard debugging sections if we areIan Lance Taylor1-1/+10
stripping debugging information.
1996-04-01 * ldlang.c (lang_size_sections): Change region check to handleIan Lance Taylor1-3/+3
regions which end at the highest possible address correctly. From Roland Weber <roweber@ira.uka.de>.
1996-04-01 * ldlang.c (section_already_linked): New static function.Ian Lance Taylor1-8/+117
(wild_doit): Discard sections with SEC_EXCLUDE set if not doing a relocateable link. Don't worry about section being NULL, since it never should be. Don't call init_os unless the section is going to be added. (ldlang_add_file): Call section_already_linked for each section. * ldmain.c (multiple_definition): Don't warn about multiple definitions in sections which are being discarded.
1996-03-27 * ld.h (DISCARD_SECTION_NAME): Define to "/DISCARD/".Ian Lance Taylor1-6/+20
* ldlang.c (init_os): Fail on an attempt to initialize any section named DISCARD_SECTION_NAME. (wild_doit): Discard input sections assigned to an output section named DISCARD_SECTION_NAME. * ld.texinfo: Document use of /DISCARD/.
1996-03-27 * ldlang.c: Fix some indentation and comments.Ian Lance Taylor1-69/+71
1996-03-04 * ldlang.c (wild): Handle foo.a(.text) by mapping each includedIan Lance Taylor1-1/+28
member of foo.a separately. From Jouke Numan <jnuman@bazis.nl>.
1996-02-27 * lexsup.c (parse_args): Recognize --no-whole-archive.Ian Lance Taylor1-1/+2
* ldlang.h (lang_input_statement_type): Add whole_archive field. * ldlang.c (new_afile): Set whole_archive field. (load_symbols): Check input file specific whole_archive field rather than global variable. * ld.texinfo, ld.1: Document --no-whole-archive. PR 9094.
1996-02-14Wed Feb 14 16:38:36 1996 Martin Anantharaman ↵Ian Lance Taylor1-1/+4
<martin@mail.imech.uni-duisburg.de> * ldlang.c (lang_set_startof): Don't do anything for a relocateable link. * ldgram.y (mri_script_file): Call mri_draw_tree. * mri.c (mri_draw_tree): Make globally visible. Don't bother to create memory regions. (mri_load): Don't call mri_draw_tree. * mri.h (mri_draw_tree): Declare. * configure.tgt (m68*-*-psos): New target. * emulparams/m68kpsos.sh: New file. * scripttempl/psos.sc: New file. * Makefile.in (ALL_EMULATIONS): Add em68kpsos.o. (em68kpsos.c): New target.
1996-02-09 * ldlang.c (lang_size_sections): Increment the section size when aIan Lance Taylor1-82/+150
padding statement is encountered. PR 8965.
1995-12-01 * ldgram.y (PHDRS): New token.Ian Lance Taylor1-2/+147
(ifile_p1): Accept phdrs. (section): Accept phdr_opt at the end of the section definition. (phdr_op): New nonterminal. (phdrs, phdr_list, phdr, phdr_type, opt_hdrs, hdr): Likewise. * ldlex.l: Accept PHDRS. * ldlang.h (struct lang_output_section_phdr_list): Define. (lang_output_section_statement_type): Add phdrs field. (struct lang_phdr): Define. (LANG_PHDR_FILEHDR, LANG_PHDR_PHDRS): Define. (lang_new_phdr): Declare. * ldlang.c (lang_phdr_list): New static variable. (lang_output_section_statement_lookup): Initialize phdrs field. (lang_process): Call lang_record_phdrs. (lang_new_phdr): New function. (lang_section_in_phdr): New function. (lang_record_phdrs): New static function. * ld.texinfo: Document PHDRS.
1995-10-04 * ldexp.c (exp_get_abs_int): Return bfd_vma, not int.Ian Lance Taylor1-15/+22
* ldexp.h (exp_get_abs_int): Update declaration. * ldlang.c (print_output_section_statement): Use fprintf_vma to print return value of exp_get_abs_int. PR 8142.
1995-09-07 * configure.host (sparc-*-sunos64*): Remove.Ian Lance Taylor1-3/+16
* ldlang.c (lang_map): Check BFD64, not HOST_64_BIT.
1995-08-16 * ldlang.c (lang_set_startof): New static function.Ian Lance Taylor1-9/+59
(lang_process): Call it.
1995-07-07fsf address update, but not in COPYING filesKen Raeburn1-2/+3
1995-05-12Fri May 12 11:03:55 1995 Steve Chamberlain <sac@slash.cygnus.com>Steve Chamberlain1-0/+23
Tom Griest <griest@cs.yale.edu> Initial support for PE executables (eg NT, win32) * Makefile.in (configure.in, ei386pe): Add support. * ldmain.c (main): Initialize PE argument info. * ldwrite.c (print_file_stuff): Don't print out .drectve and .debug section info. * lexsup.c (set_subsystem, set_stack_heap, OPTION_HEAP, OPTION_SUBSYSTEM, parse_argsm set_subsystem, set_stack_heap): Handle new arguments. * config/i386-pe.mt, emultempl/i386pe.em, scripttempl/i386pe.sc: New files
1995-05-03* ldlang.c (print_output_section_statement): Check subsection_alignment,Ken Raeburn1-5/+4
instead of checking section_alignment twice. Noticed by Alan Modra <alan@spri.levels.unisa.edu.au>.
1995-03-18 * ldlang.c (load_symbols): An empty is archive is OK.Ian Lance Taylor1-4/+37
1995-02-06 * ldctor.c (ldctor_build_sets): Handle bfd_link_hah_defweak.Ian Lance Taylor1-2/+4
* 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.
1995-02-01 * ldlang.c (lang_size_sections): Clarify error message when userDavid Edelsohn1-25/+37
specified start addr conflicts with region. Fix resetting of region pointer.
1995-01-12Don't use const with reloc_howto_type, since it's now defined to be const.Ken Raeburn1-2/+9
1994-11-09 * ldlang.c (lang_one_common): Set SEC_ALLOC in any section whereIan Lance Taylor1-0/+3
we allocate common symbols.
1994-11-08 * ldlang.c (load_symbols): Add new argument place. Only acceptIan Lance Taylor1-8/+39
linker scripts if place is not NULL. Put commands found in an assumed linker script into place. (lookup_name): Pass NULL as place argument to load_symbols. (open_input_bfds): In lang_input_statement_enum case, pass a place argument to load_symbols, and store any new statements after the current one. PR 5917.
1994-09-14Wed Sep 14 12:49:12 1994 Steve Chamberlain (sac@jonny.cygnus.com)Steve Chamberlain1-2/+7
* ldlang.c (lang_do_assignments): Make sure output statement has an attached bfd_section before trying to dereference it.
1994-09-14 * ldlang.c (print_output_section_statement): Print all linesSteve Chamberlain1-6/+6
to the map file.
1994-09-13 * ldlang.c (load_symbols): Check for archive before object. UseIan Lance Taylor1-53/+60
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.
1994-07-22 * ldlang.c (lang_common): Pass desired alignment toIan Lance Taylor1-33/+8
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.
1994-07-22 * ldlang.c (wild_section): Attach all section with the given name,Ian Lance Taylor1-52/+146
not just the first one. If there is no name, attach all sections even if the SEC_IS_COMMON flag is set.
1994-06-22 * ldlang.c (end_of_data_section_statement_list): Don't define.Ian Lance Taylor1-13/+0
(lang_leave_output_section_statement): Don't set obsolete variable end_of_data_section_statement_list.
1994-06-22 * ldlang.c (lang_size_sections): Adjust current region addressIan Lance Taylor1-11/+12
even for sections with an explicit address. From ralphc@pyramid.com (Ralph Campbell).
1994-06-15 * ld.h (ld_config_type): Add new field traditional_format.Ian Lance Taylor1-0/+4
* 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-09 * ldlang.c (map_input_to_output_sections): For lang_address, callIan Lance Taylor1-7/+4
init_os if it hasn't already been called.
1994-06-02 * ldlang.c: Minor formatting cleanups.Ian Lance Taylor1-20/+18
(lang_for_each_input_file): New function. * ldlang.h (lang_for_each_input_file): Declare.
1994-06-01 * ldlang.h (lang_input_statement_type): Remove fields subfiles,Ian Lance Taylor1-1/+0
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-27 * ldlang.c (entry_symbol): Make static.Ian Lance Taylor1-4/+17
(lang_add_entry): Add cmdline argument. * ldlang.h (lang_add_entry): Change prototype. * ldgram.y (statement_anywhere): Change lang_add_entry call. * lexsup.c (parse_args): Likewise.
1994-05-27 * ldlang.c (lang_add_entry): Only set the entry symbol if it hasIan Lance Taylor1-1/+2
not been set already.
1994-05-13 * ldlang.c (print_output_section_statement): Change ``no attachedIan Lance Taylor1-5/+9
output section'' message slightly. (lang_do_assignments): Don't recurse down if there is no real section.
1994-05-11 Don't create unnecessary output sections.Ian Lance Taylor1-47/+22
* 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.
1994-05-10 * ldlang.c (wild_doit): Don't bother initializing the vma andIan Lance Taylor1-45/+60
section size. Don't special case SEC_SHARED_LIBRARY. (lang_size_sections): Handle SEC_COFF_SHARED_LIBRARY sections specially.
1994-04-25 * ldlang.c (lang_size_sections): When no address is given for aIan Lance Taylor1-0/+2
section, align it according to its requirements.
1994-04-15 * ldlang.c (lang_size_sections): When relaxing, adjust theIan Lance Taylor1-1/+13
position of a padding statement, and adjust dot accordingly.