* ldgram.y, ldlex.c, mri.c: added more compatible words; BASE, ALIAS and
PUBLIC. * Makefile.in: now use flex, not lex
This commit is contained in:
parent
d3451fe888
commit
e14a43bfaf
3 changed files with 30 additions and 12 deletions
|
@ -6,6 +6,9 @@ Fri May 1 18:17:52 1992 K. Richard Pixley (rich@cygnus.com)
|
||||||
|
|
||||||
Fri May 1 13:03:41 1992 Steve Chamberlain (sac@thepub.cygnus.com)
|
Fri May 1 13:03:41 1992 Steve Chamberlain (sac@thepub.cygnus.com)
|
||||||
|
|
||||||
|
* ldgram.y, ldlex.c, mri.c: added more compatible words; BASE, ALIAS and
|
||||||
|
PUBLIC.
|
||||||
|
* Makefile.in: now use flex, not lex
|
||||||
* ldlex.l, ldlang.c, ldctor.c: lint
|
* ldlex.l, ldlang.c, ldctor.c: lint
|
||||||
|
|
||||||
Wed Apr 22 12:48:42 1992 Steve Chamberlain (sac@thepub.cygnus.com)
|
Wed Apr 22 12:48:42 1992 Steve Chamberlain (sac@thepub.cygnus.com)
|
||||||
|
|
|
@ -50,7 +50,7 @@ SHELL = /bin/sh
|
||||||
INSTALL = install -c
|
INSTALL = install -c
|
||||||
INSTALL_PROGRAM = $(INSTALL)
|
INSTALL_PROGRAM = $(INSTALL)
|
||||||
INSTALL_DATA = $(INSTALL)
|
INSTALL_DATA = $(INSTALL)
|
||||||
|
FLEX=flex
|
||||||
AR = ar
|
AR = ar
|
||||||
AR_FLAGS = qv
|
AR_FLAGS = qv
|
||||||
CFLAGS = -g
|
CFLAGS = -g
|
||||||
|
@ -169,7 +169,8 @@ ldemul.o: ldemul-list.h
|
||||||
|
|
||||||
ldlex.c: ldlex.l
|
ldlex.c: ldlex.l
|
||||||
# /lib/cpp -E -P $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CDEFINES) $(VPATH)/ldlex.l >ldlex.p
|
# /lib/cpp -E -P $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CDEFINES) $(VPATH)/ldlex.l >ldlex.p
|
||||||
$(LEX) -Cem -t $(VPATH)/ldlex.l >ldlex.c
|
|
||||||
|
$(FLEX) -I -Cem -t $(VPATH)/ldlex.l >ldlex.c
|
||||||
# cp ldlex.q ldlex.c
|
# cp ldlex.q ldlex.c
|
||||||
|
|
||||||
|
|
||||||
|
|
32
ld/ldgram.y
32
ld/ldgram.y
|
@ -133,7 +133,7 @@ struct sec *section;
|
||||||
%token '{' '}'
|
%token '{' '}'
|
||||||
%token SIZEOF_HEADERS OUTPUT_FORMAT FORCE_COMMON_ALLOCATION OUTPUT_ARCH
|
%token SIZEOF_HEADERS OUTPUT_FORMAT FORCE_COMMON_ALLOCATION OUTPUT_ARCH
|
||||||
%token SIZEOF_HEADERS
|
%token SIZEOF_HEADERS
|
||||||
%token MEMORY
|
%token MEMORY DEFSYMEND
|
||||||
%token NOLOAD DSECT COPY INFO OVERLAY
|
%token NOLOAD DSECT COPY INFO OVERLAY
|
||||||
%token NAME DEFINED TARGET_K SEARCH_DIR MAP ENTRY
|
%token NAME DEFINED TARGET_K SEARCH_DIR MAP ENTRY
|
||||||
%token OPTION_e OPTION_c OPTION_noinhibit_exec OPTION_s OPTION_S OPTION_sort_common
|
%token OPTION_e OPTION_c OPTION_noinhibit_exec OPTION_s OPTION_S OPTION_sort_common
|
||||||
|
@ -152,7 +152,8 @@ struct sec *section;
|
||||||
%type <name> filename
|
%type <name> filename
|
||||||
|
|
||||||
|
|
||||||
%token CHIP LIST SECT ABSOLUTE LOAD NEWLINE ENDWORD ORDER NAMEWORD FORMAT
|
%token CHIP LIST SECT ABSOLUTE LOAD NEWLINE ENDWORD ORDER NAMEWORD
|
||||||
|
%token FORMAT PUBLIC DEFSYMEND BASE ALIAS
|
||||||
|
|
||||||
%{
|
%{
|
||||||
ld_config_type config;
|
ld_config_type config;
|
||||||
|
@ -269,11 +270,11 @@ command_line_option:
|
||||||
lang_add_target($2);
|
lang_add_target($2);
|
||||||
}
|
}
|
||||||
| OPTION_Texp
|
| OPTION_Texp
|
||||||
{
|
{ ldlex_expression();
|
||||||
hex_mode = 16;
|
hex_mode = 16;
|
||||||
}
|
}
|
||||||
INT
|
INT
|
||||||
{
|
{ ldlex_popstate();
|
||||||
lang_section_start($1,exp_intop($3));
|
lang_section_start($1,exp_intop($3));
|
||||||
hex_mode = 0;
|
hex_mode = 0;
|
||||||
}
|
}
|
||||||
|
@ -320,10 +321,9 @@ END { ldlex_command();}
|
||||||
lang_input_file_is_symbols_only_enum,
|
lang_input_file_is_symbols_only_enum,
|
||||||
(char *)NULL);
|
(char *)NULL);
|
||||||
}
|
}
|
||||||
| OPTION_defsym { ldlex_expression();
|
|
||||||
|
|
||||||
}
|
| OPTION_defsym { ldlex_defsym(); }
|
||||||
NAME '=' mustbe_exp { ldlex_popstate();
|
NAME '=' exp DEFSYMEND { ldlex_popstate();
|
||||||
lang_add_assignment(exp_assop($4,$3,$5));
|
lang_add_assignment(exp_assop($4,$3,$5));
|
||||||
}
|
}
|
||||||
| '-' NAME
|
| '-' NAME
|
||||||
|
@ -361,6 +361,12 @@ mri_script_command:
|
||||||
}
|
}
|
||||||
| ORDER ordernamelist
|
| ORDER ordernamelist
|
||||||
| ENDWORD
|
| ENDWORD
|
||||||
|
| PUBLIC NAME '=' exp
|
||||||
|
{ mri_public($2, $4); }
|
||||||
|
| PUBLIC NAME ',' exp
|
||||||
|
{ mri_public($2, $4); }
|
||||||
|
| PUBLIC NAME exp
|
||||||
|
{ mri_public($2, $3); }
|
||||||
| FORMAT NAME
|
| FORMAT NAME
|
||||||
{ mri_format($2); }
|
{ mri_format($2); }
|
||||||
| SECT NAME ',' exp
|
| SECT NAME ',' exp
|
||||||
|
@ -373,6 +379,12 @@ mri_script_command:
|
||||||
| LOAD mri_load_name_list
|
| LOAD mri_load_name_list
|
||||||
| NAMEWORD NAME
|
| NAMEWORD NAME
|
||||||
{ mri_name($2); }
|
{ mri_name($2); }
|
||||||
|
| ALIAS NAME ',' NAME
|
||||||
|
{ mri_alias($2,$4,0);}
|
||||||
|
| ALIAS NAME ',' INT
|
||||||
|
{ mri_alias($2,0,$4);}
|
||||||
|
| BASE exp
|
||||||
|
{ mri_base($2); }
|
||||||
|
|
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -750,10 +762,12 @@ section: NAME { ldlex_expression(); }
|
||||||
{
|
{
|
||||||
lang_enter_output_section_statement($1,$3,$5,$6);
|
lang_enter_output_section_statement($1,$3,$5,$6);
|
||||||
}
|
}
|
||||||
statement '}' fill_opt memspec_opt
|
statement '}' {ldlex_expression();} fill_opt memspec_opt
|
||||||
{
|
{
|
||||||
lang_leave_output_section_statement($13, $14);
|
ldlex_popstate();
|
||||||
|
lang_leave_output_section_statement($14, $15);
|
||||||
}
|
}
|
||||||
|
opt_comma
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue