aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlex.l
AgeCommit message (Collapse)AuthorFilesLines
1998-07-08 * ldgram.y: Change MAX to MAX_K and MIN to MIN_K, to avoidIan Lance Taylor1-2/+2
conflicts with system header files. Change all uses.
1998-07-03 * ldgram.y (extern_name_list): Do not require symbols to beIan Lance Taylor1-1/+1
separated by commas. (ifile_p1): Add EXTERN. * ldlex.l: Accept EXTERN in BOTH and SCRIPT mode as well as MRI mode. * ld.texinfo (Options): Mention that EXTERN is equivalent to -u. (Miscellaneous Commands): Document EXTERN.
1998-07-02 * ld.h (args_type): Add gc_sections.Richard Henderson1-28/+43
* ldgram.y (ldgram_had_keep, KEEP): New. (input_section_spec_no_keep): Rename from old input_section_spec. (input_section_spec): New. Recognize KEEP. * ldlang.c (wild_section): Handle keep sections. (lang_gc_wild_section, lang_gc_wild_file, lang_gc_wild): New. (lang_gc_sections_1, lang_gc_sections): New. (lang_process): Invoke lang_gc_sections. (lang_add_wild): Add keep argument. Update all callers. * ldlang.h (lang_wild_statement_struct): Add keep_sections. * ldlex.l (KEEP): Match it. * ldmain.c (main): Error on -r and --gc-sections. * lexsup.c: Add --gc-sections. * scripttempl/elf.sc: Merge .text.* etc sections appropriately. Mark startup sections with KEEP. * scripttempl/elfppc.sc: Likewise. * ld.texinfo: Update for --gc-sections and KEEP.
1997-06-16Mon Jun 16 12:49:36 1997 H.J. Lu <hjl@gnu.ai.mit.edu>Ian Lance Taylor1-5/+56
* ldlang.c (lang_place_undefineds): Add \n in einfo call. (lang_size_sections): Likewise. * ldlex.l: Likewise. * emultempl/aix.em (gld${EMULATION_NAME}_read_file): Likewise. * emultempl/mipsecoff.em (gld${EMULATION_NAME}_after_open): Likewise. (check_sections): Likewise. (gld${EMULATION_NAME}_after_allocation): Likewise. * emultempl/pe.em (gld_$${EMULATION_NAME}_before_allocation): Likewise. * mpw-eppcmac.c (gldppcmacos_read_file): Likewise. * mpw-idtmips.c (gldmipsidt_after_open): Likewise. (check_sections): Likewise. (gldmipsidt_after_allocation): Likewise.
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/+1
* 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-29 * fnmatch.h, fnmatch.c: New files.Ian Lance Taylor1-63/+118
* 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.
1994-07-22 * scripttempl/elf.sc: Use PROVIDE to define etext, edata, and end.Ian Lance Taylor1-4/+13
Add a new script operator, PROVIDE, to define a symbol only if it is needed. * ldgram.y (PROVIDE): New token. (assignment): Accept PROVIDE. * ldlex.l (PROVIDE): New token. * ldexp.h (node_type): Add etree_provide to node_class enum. (exp_provide): Declare. * ldexp.c (exp_fold_tree): Handle etree_provide. (exp_provide): New function. (exp_print_tree): Handle etree_provide. * ld.texinfo: Document PROVIDE.
1994-02-25 Use getopt instead of lex and yacc to parse the command line.David MacKenzie1-237/+110
* 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-01-28 * ldlex.l: Add rule to catch invalid input characters instead ofDavid MacKenzie1-6/+20
printing them. Include "ldmain.h" for program_name decl. (lex_warn_invalid): New function. * Makefile.in: Add dependency.
1994-01-26Tue Jan 25 19:54:19 1994 Stan Shebs (shebs@andros.cygnus.com)Stan Shebs1-1/+19
* mpw-config.in: New file, MPW configuration fragment. * mpw-build.in: New file, MPW build script fragment. * mpw-make.in: New file, MPW makefile fragment. (This file is semi-automatically generated from Makefile.in.) * ldfile.c (slash): If MPW, set to `:'. * ldlex.l (TRUE_FALSE_ALREADY_DEFINED): If MPW, set this to prevent redefinition errors.
1994-01-06 * ld.h (QUAD_SIZE): Define.Ian Lance Taylor1-1/+5
* ldgram.y (QUAD): New token. (length): Handle it. * ldlex.l: Return QUAD. * lexsup.c (keywords): Add QUAD. * ldwrite.c (build_link_order): Handle QUAD. * ldlang.c (print_data_statement): Handle QUAD. (lang_size_sections): Likewise. (lang_do_assignments): Likewise. * ldexp.c (exp_print_token): Add QUAD to table. * ld.texinfo: Describe QUAD.
1993-12-12More gcc lint.Ian Lance Taylor1-8/+7
1993-12-11 Made many changes to eliminate gcc warnings. Made variousIan Lance Taylor1-13/+19
cosmetic changes, declared various things in header files, removed various extern declarations from .c files. No substantive changes.
1993-12-01 * ldgram.y (OPTION_call_shared, OPTION_non_shared): New tokens.Ian Lance Taylor1-3/+7
(command_line_option): Accept and ignore them (for now). * ldlex.l (<COMMAND>): Handle -non_shared and -call_shared.
1993-08-05add missing newlines in messagesDavid MacKenzie1-3/+3
1993-08-03add -warn-common optionDavid MacKenzie1-3/+14
1993-07-07Don't define bfd_vma here!Ken Raeburn1-4/+7
(Wasted at least a day tracking this damn thing down...)
1993-06-17 * ldfile.c (ldfile_open_command): Don't try .ld extension.David MacKenzie1-21/+30
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.
1993-03-30 Support for linking and loading at different places:Steve Chamberlain1-1/+9
* ldlex.l: Add "AT" keyword. * ldgram.y: Cleanup, and parse AT. * ldlang.c (print_output_section_statement): Print output address of section in map. (lang_size_sections): Fill sections' lma with load address. * ldlang.h (lang_output_section_statement_type): Add load_base information.
1993-01-08 Fix support for NOLOAD, add INCLUDESteve Chamberlain1-33/+50
* ldfile.c (ldfile_open_command_file): pass file name to lex_push_file. * ldlex.l, ldgram.y: tidy up, parse INCLUDE and NOLOAD * ldlang.c (wild_doit): make output sections inherit NEVER_LOAD attribute.
1992-12-07 -y supportSteve Chamberlain1-32/+54
* ld.texinfo: new doc. * ldgram.y, ldlex.l: understand -y<symbol> * ldmain.c (Q_enter_file_symbols): if had -y, lookup symbol and print info. (add_ysym): new function. * ldsym.h: (ldsym_type): new define SYM_Y.
1992-08-13 * ldlex.l: now parses comment correctly, added ~ to acceptableSteve Chamberlain1-16/+42
chars in filenames * ldexp.c (exp_unop): pass down abs_output_section - now can have unary -ve constants. * ldlang.c (lang_finish): warn when an entry symbol supplied on the command line can't be found.
1992-05-22 * ldlex.c: Fix some unnecessary flex-specific-isms.Per Bothner1-21/+13
1992-05-01lintSteve Chamberlain1-4/+4
1992-04-22 * ldlex.l: added CMDFILENAMECHAR state so that you can lexSteve Chamberlain1-1/+10
different sorts of filenames on the command line than in a script.
1992-04-17 * relax.c: added handling for new "padding" seclet type, used toSteve Chamberlain1-4/+19
fill out gaps between section. * ldgram.y, ldlex.l: now -defsym on the command line is done properly.
1992-04-16Lint found by Rich and gccSteve Chamberlain1-0/+9
1992-04-15Strange link script supportSteve Chamberlain1-4/+7
1992-04-15Personal checkpoint - now should parse some MRI stuffSteve Chamberlain1-6/+50
1992-04-05New lexer.Steve Chamberlain1-462/+355
New targets for h8/300 simulator and DOS
1992-01-24 * Makefile.in: added relax, also made three stage go through aSteve Chamberlain1-5/+19
partial link stage. * relax.c : added * config.h: if GNU960 defined, then default emulation mode is GLD960 * ldexp.h, ldexp.c: map to file hooks * ldlang.c: map to file hooks * ldgram.y: added -Map -relax * ldlex.l: added -relax, -Map * ldmain.c: open map file * ldmisc.c: support for map file * ldwrite.c: new relax magic
1991-06-04*** empty log message ***Steve Chamberlain1-1/+5
1991-05-07Fixed the shift reduce errors in the grammer using the yacc debugger.Steve Chamberlain1-3/+0
Removed some lint highlighted by the same.
1991-05-03*** empty log message ***Steve Chamberlain1-0/+1
1991-04-24Added the sizeof_headers keyword.Steve Chamberlain1-0/+2
1991-04-23*** empty log message ***Steve Chamberlain1-6/+25
1991-04-19Yet more diffs due to my incompetence.Steve Chamberlain1-111/+97
1991-04-18Fixed some bugs.Steve Chamberlain1-35/+31
1991-04-17Added keywordsSteve Chamberlain1-1/+3
FORCE_COMMON_ALLOCATION OUTPUT_FORMAT
1991-04-16*** empty log message ***Steve Chamberlain1-1/+1
1991-04-14checkpoint before a mergeSteve Chamberlain1-47/+98
1991-04-03Fixed some grammer ambiguitiesSteve Chamberlain1-73/+49
Better error reporting sun3 support
1991-03-21Initial revisionDavid Henkel-Wallace1-0/+490