+Tue Aug 15 17:31:16 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * 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.
+
Tue Aug 8 19:14:58 1995 Ken Raeburn <raeburn@kr-laptop.cygnus.com>
* emultempl/sunos.em (gld${EMULATION_NAME}_find_so): Use xmalloc
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. */
%{
/*
#include "mri.h"
#include "ldlex.h"
+#ifndef YYDEBUG
+#define YYDEBUG 1
+#endif
+
static int typebits;
lang_memory_region_type *region;
%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
%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
%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
%%
}
| 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);}
{ 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); }
|
;
{ 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();
| 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
| 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: