diff options
author | Ian Lance Taylor <ian@airs.com> | 1995-08-15 21:35:46 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1995-08-15 21:35:46 +0000 |
commit | 3a473096422919ee478a7ccfaea3887fc11936db (patch) | |
tree | d252774648afb4b4347e7bcfe3b9f8157c244325 /ld/ldgram.y | |
parent | f5cf5e17bfbdc3a7224fbbfcfa27de640bad836d (diff) | |
download | gdb-3a473096422919ee478a7ccfaea3887fc11936db.zip gdb-3a473096422919ee478a7ccfaea3887fc11936db.tar.gz gdb-3a473096422919ee478a7ccfaea3887fc11936db.tar.bz2 |
* ldgram.y (YYDEBUG): If not defined, define as 1.
(CASE, EXTERN, START): New tokens.
(mri_script_command): Handle CASE, EXTERN, INCLUDE, START.
(casesymlist): New nonterminal.
(extern_name_list): New nonterminal.
* ldlex.l: Accept lower case trailing base specifiers. Don't
ignore the first digit when the base is a suffix. Accept many
EXPRESSION state tokens in MRI state. Support MRI continuation
lines and MRI semicolon comments. Accept all MRI keywords in
lower case. Add CASE, EXTERN, and START MRI keywords.
Diffstat (limited to 'ld/ldgram.y')
-rw-r--r-- | ld/ldgram.y | 51 |
1 files changed, 43 insertions, 8 deletions
diff --git a/ld/ldgram.y b/ld/ldgram.y index 7d13971..4967145 100644 --- a/ld/ldgram.y +++ b/ld/ldgram.y @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ %{ /* @@ -39,6 +39,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "mri.h" #include "ldlex.h" +#ifndef YYDEBUG +#define YYDEBUG 1 +#endif + static int typebits; lang_memory_region_type *region; @@ -70,7 +74,7 @@ static int error_index; %type <integer> fill_opt %type <name> memspec_opt %token <integer> INT -%token <name> NAME +%token <name> NAME LNAME %type <integer> length %right <token> PLUSEQ MINUSEQ MULTEQ DIVEQ '=' LSHIFTEQ RSHIFTEQ ANDEQ OREQ @@ -98,7 +102,7 @@ static int error_index; %token INCLUDE %token MEMORY DEFSYMEND %token NOLOAD DSECT COPY INFO OVERLAY -%token NAME DEFINED TARGET_K SEARCH_DIR MAP ENTRY +%token NAME LNAME DEFINED TARGET_K SEARCH_DIR MAP ENTRY %token <integer> SIZEOF NEXT ADDR %token STARTUP HLL SYSLIB FLOAT NOFLOAT %token ORIGIN FILL @@ -108,7 +112,7 @@ static int error_index; %type <name> filename %token CHIP LIST SECT ABSOLUTE LOAD NEWLINE ENDWORD ORDER NAMEWORD %token FORMAT PUBLIC DEFSYMEND BASE ALIAS TRUNCATE REL -%token INPUT_SCRIPT INPUT_MRI_SCRIPT INPUT_DEFSYM +%token INPUT_SCRIPT INPUT_MRI_SCRIPT INPUT_DEFSYM CASE EXTERN START %% @@ -157,15 +161,15 @@ mri_script_command: } | ORDER ordernamelist | ENDWORD - | PUBLIC NAME '=' exp + | PUBLIC NAME '=' exp { mri_public($2, $4); } - | PUBLIC NAME ',' exp + | PUBLIC NAME ',' exp { mri_public($2, $4); } | PUBLIC NAME exp { mri_public($2, $3); } | FORMAT NAME { mri_format($2); } - | SECT NAME ',' exp + | SECT NAME ',' exp { mri_output_section($2, $4);} | SECT NAME exp { mri_output_section($2, $3);} @@ -187,6 +191,12 @@ mri_script_command: { mri_base($2); } | TRUNCATE INT { mri_truncate((unsigned int) $2); } + | CASE casesymlist + | EXTERN extern_name_list + | INCLUDE filename + { ldfile_open_command_file ($2); } mri_script_lines END + | START NAME + { lang_add_entry ($2, 0); } | ; @@ -209,6 +219,19 @@ mri_abs_name_list: { mri_only_load($3); } ; +casesymlist: + /* empty */ + | NAME + | casesymlist ',' NAME + ; + +extern_name_list: + NAME + { ldlang_add_undef ($1); } + | extern_name_list ',' NAME + { ldlang_add_undef ($3); } + ; + script_file: { ldlex_both(); @@ -243,7 +266,10 @@ ifile_p1: | OUTPUT '(' filename ')' { lang_add_output($3, 1); } | OUTPUT_FORMAT '(' NAME ')' - { lang_add_output_format($3, 1); } + { lang_add_output_format ($3, (char *) NULL, + (char *) NULL, 1); } + | OUTPUT_FORMAT '(' NAME ',' NAME ',' NAME ')' + { lang_add_output_format ($3, $5, $7, 1); } | OUTPUT_ARCH '(' NAME ')' { ldfile_set_output_arch($3); } | FORCE_COMMON_ALLOCATION @@ -269,6 +295,15 @@ input_list: | input_list NAME { lang_add_input_file($2,lang_input_file_is_search_file_enum, (char *)NULL); } + | LNAME + { lang_add_input_file($1,lang_input_file_is_l_enum, + (char *)NULL); } + | input_list ',' LNAME + { lang_add_input_file($3,lang_input_file_is_l_enum, + (char *)NULL); } + | input_list LNAME + { lang_add_input_file($2,lang_input_file_is_l_enum, + (char *)NULL); } ; sections: |