+Wed Apr 15 16:09:33 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * mri.c, ldgram.y, ldlex.l: added support for minimal strange link
+ scripts.
+
Thu Apr 9 05:52:02 1992 Ken Raeburn (Raeburn@Cygnus.COM)
* Makefile.in (install): Install second copy in $(tooldir)/bin
/*%token <token> '+' '-' '*' '/' '%'*/
%right UNARY
-%token END
+%token END
%left <token> '('
%token <token> ALIGN_K BLOCK LONG SHORT BYTE
%token SECTIONS
%type <name> filename
-%token CHIP LIST SECT ABSOLUTE LOAD
+%token CHIP LIST SECT ABSOLUTE LOAD NEWLINE ENDWORD ORDER NAMEWORD FORMAT
%{
ld_config_type config;
;
mri_script_lines:
- mri_script_lines mri_script_line
- |
+ mri_script_lines mri_script_command NEWLINE
+ |
;
-mri_script_line:
+mri_script_command:
CHIP exp
| CHIP exp ',' exp
| NAME {
- einfo("%P%F: unrecognised keyword in MRI style script '%s'\n",
- $1);
+ einfo("%P%F: unrecognised keyword in MRI style script '%s'\n",$1);
}
| LIST {
write_map = true;
config.map_filename = "-";
}
- | SECT NAME ',' exp
+ | ORDER ordernamelist
+ | ENDWORD
+ | FORMAT NAME
+ { mri_format($2); }
+ | SECT NAME ',' exp
{ mri_output_section($2, $4);}
| SECT NAME exp
{ mri_output_section($2, $3);}
{ mri_output_section($2, $4);}
| ABSOLUTE mri_abs_name_list
| LOAD mri_load_name_list
+ | NAMEWORD NAME
+ { mri_name($2); }
+ |
+ ;
+
+ordernamelist:
+ ordernamelist ',' NAME { mri_order($3); }
+ | ordernamelist NAME { mri_order($2); }
+ |
;
mri_load_name_list:
%a 4000
%o 5000
FILENAMECHAR1 [_a-zA-Z\/\.\\]
-FILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\=\$\:\[\]\\]
+FILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\$\:\[\]\\]
FILENAME {FILENAMECHAR}+
WHITE [ \t\n]+
<BOTH,SCRIPT>"org" { RTOKEN(ORIGIN);}
<BOTH,SCRIPT>"l" { RTOKEN( LENGTH);}
<BOTH,SCRIPT>"len" { RTOKEN( LENGTH);}
-
+<MRI>"\n" { ++ lineno; RTOKEN(NEWLINE); }
<MRI>^"*".* { /* Mri comment line */ }
-<MRI>\n { ++ lineno; }
+<MRI>"END" { RTOKEN(ENDWORD); }
<MRI>"CHIP" { RTOKEN(CHIP); }
<MRI>"LOAD" { RTOKEN(LOAD); }
-<MRI>"LIST".*\n { RTOKEN(LIST); /* LIST and ignore to end of line */ }
+<MRI>"ORDER" { RTOKEN(ORDER); }
+<MRI>"NAME" { RTOKEN(NAMEWORD); }
+<MRI>"FORMAT" { RTOKEN(FORMAT); }
+<MRI>"LIST".* { RTOKEN(LIST); /* LIST and ignore to end of line */ }
<MRI>"SECT" { RTOKEN(SECT); }
<MRI>"ABSOLUTE" { RTOKEN(ABSOLUTE); }
os->flags = 0;
os->block_value = 0;
- }
+}
/* if any ABSOLUTE <name> are in the script, only load those files
marked thus */
void DEFUN(mri_only_load,(name), CONST char *name)
- {
+{
+ lang_output_section_statement_type *os;
+ os = lang_output_section_statement_lookup(name);
+ os->flags = 0;
+ os->block_value = 0;
}
lang_add_input_file(name, lang_input_file_is_file_enum, (char *)NULL);
}
+
+
+void
+DEFUN(mri_order,(name),
+ CONST char *name)
+{
+einfo("Ignoring ORDER %s for the moment\n", name);
+
+}
+
+void
+DEFUN(mri_name,(name),
+ CONST char *name)
+{
+ lang_add_output(name);
+
+}
+
+
+void
+DEFUN(mri_format,(name),
+ CONST char *name)
+{
+ if (strcmp(name, "S") == 0)
+ {
+ lang_add_output_format("srec");
+ }
+ else if (strcmp(name, "IEEE") == 0)
+ {
+ lang_add_output_format("ieee");
+ }
+ else {
+ einfo("%P%F: unknown format type %s\n", name);
+ }
+}