* 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.
This commit is contained in:
parent
f5cf5e17bf
commit
3a47309642
2 changed files with 56 additions and 8 deletions
13
ld/ChangeLog
13
ld/ChangeLog
|
@ -1,3 +1,16 @@
|
|||
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
|
||||
|
|
51
ld/ldgram.y
51
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:
|
||||
|
|
Loading…
Reference in a new issue