From 8ddef5528d34f05ff9a492e23b15ef5c6c8eb5fb Mon Sep 17 00:00:00 2001 From: David MacKenzie Date: Thu, 17 Jun 1993 20:55:43 +0000 Subject: * ldfile.c (ldfile_open_command): Don't try .ld extension. 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. --- ld/ldlex.l | 51 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 21 deletions(-) (limited to 'ld/ldlex.l') diff --git a/ld/ldlex.l b/ld/ldlex.l index 98ea160..606f65a 100644 --- a/ld/ldlex.l +++ b/ld/ldlex.l @@ -119,6 +119,8 @@ NOCFILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\$\:\[\]\\\~] "-d" { return OPTION_d; } "-v" { return OPTION_v; } "-V" { return OPTION_V; } +"-m" { return OPTION_m; } +"-m"{FILENAME} { return OPTION_memul; } "-M" { return OPTION_M; } "-Map" { return OPTION_Map;} "-t" { return OPTION_t; } @@ -184,12 +186,19 @@ NOCFILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\$\:\[\]\\\~] "-retain-symbols-file" { return OPTION_RETAIN_SYMBOLS_FILE; } -"-EB" { - return OPTION_EB; - } -"-EL" { - return OPTION_EL; - } +"-EB" { + return OPTION_EB; + } +"-EL" { + return OPTION_EL; + } +"-G" { + return OPTION_G; + } +"-G"([0-9])+ { + yylval.integer = atoi (yytext + 2); + return OPTION_Gval; + } "$"([0-9A-Fa-f])+ { yylval.integer = strtoul(yytext+1, 0,16); return INT; @@ -400,9 +409,9 @@ NOCFILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\$\:\[\]\\\~] %% void -DEFUN(lex_push_file,(file,name), - FILE *file AND - char *name) +lex_push_file (file, name) + FILE *file; + char *name; { if (include_stack_ptr >= MAX_INCLUDE_DEPTH) { @@ -419,9 +428,9 @@ DEFUN(lex_push_file,(file,name), } YY_BUFFER_STATE -DEFUN(yy_create_string_buffer,(string, size), - CONST char *string AND - int size ) +yy_create_string_buffer (string, size) + CONST char *string; + int size; { YY_BUFFER_STATE b; @@ -457,8 +466,8 @@ DEFUN(yy_create_string_buffer,(string, size), void -DEFUN(lex_redirect,( string), - CONST char *string) +lex_redirect (string) + CONST char *string; { YY_BUFFER_STATE tmp; @@ -482,7 +491,7 @@ int state_stack[20]; int *state_stack_p = state_stack; void -DEFUN_VOID(ldlex_script) +ldlex_script () { *(state_stack_p)++ = yy_start; @@ -491,41 +500,41 @@ DEFUN_VOID(ldlex_script) void -DEFUN_VOID(ldlex_mri_script) +ldlex_mri_script () { *(state_stack_p)++ = yy_start; BEGIN(MRI); } void -DEFUN_VOID(ldlex_defsym) +ldlex_defsym () { *(state_stack_p)++ = yy_start; BEGIN(DEFSYMEXP); } void -DEFUN_VOID(ldlex_expression) +ldlex_expression () { *(state_stack_p)++ = yy_start; BEGIN(EXPRESSION); } void -DEFUN_VOID(ldlex_both) +ldlex_both () { *(state_stack_p)++ = yy_start; BEGIN(BOTH); } void -DEFUN_VOID(ldlex_command) +ldlex_command () { *(state_stack_p)++ = yy_start; BEGIN(COMMAND); } void -DEFUN_VOID(ldlex_popstate) +ldlex_popstate () { yy_start = *(--state_stack_p); } -- cgit v1.1