3 /* Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 1998
4 Free Software Foundation, Inc.
6 This file is part of GLD, the Gnu Linker.
8 GLD is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
13 GLD is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GLD; see the file COPYING. If not, write to the Free
20 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
24 This was written by steve chamberlain
34 /* Prevent enum redefinition problems. */
35 #define TRUE_FALSE_ALREADY_DEFINED
49 /* The type of top-level parser input.
50 yylex and yyparse (indirectly) both check this. */
51 input_type parser_input;
53 /* Line number in the current input file.
54 (FIXME Actually, it doesn't appear to get reset for each file?) */
55 unsigned int lineno = 1;
57 /* The string we are currently lexing, or NULL if we are reading a
59 const char *lex_string = NULL;
61 /* Support for flex reading from more than one input file (stream).
62 `include_stack' is flex's input state for each open file;
63 `file_name_stack' is the file names. `lineno_stack' is the current
66 If `include_stack_ptr' is 0, we haven't started reading anything yet.
67 Otherwise, stack elements 0 through `include_stack_ptr - 1' are valid. */
70 #define YY_INPUT(buf,result,max_size) yy_input(buf, &result, max_size)
72 #define MAX_INCLUDE_DEPTH 10
73 static YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
74 static const char *file_name_stack[MAX_INCLUDE_DEPTH];
75 static unsigned int lineno_stack[MAX_INCLUDE_DEPTH];
76 static unsigned int include_stack_ptr = 0;
78 static YY_BUFFER_STATE yy_create_string_buffer PARAMS ((const char *string,
80 static void yy_input PARAMS ((char *, int *result, int max_size));
82 static void comment PARAMS ((void));
83 static void lex_warn_invalid PARAMS ((char *where, char *what));
86 EXPRESSION definitely in an expression
87 SCRIPT definitely in a script
88 BOTH either EXPRESSION or SCRIPT
89 DEFSYMEXP in an argument to -defsym
91 VERS_START starting a Sun style mapfile
92 VERS_SCRIPT a Sun style mapfile
93 VERS_NODE a node within a Sun style mapfile
95 #define RTOKEN(x) { yylval.token = x; return x; }
97 /* Some versions of flex want this. */
99 int yywrap () { return 1; }
106 CMDFILENAMECHAR [_a-zA-Z0-9\/\.\\_\+\$\:\[\]\\\,\=\&\!\<\>\-\~]
107 CMDFILENAMECHAR1 [_a-zA-Z0-9\/\.\\_\+\$\:\[\]\\\,\=\&\!\<\>\~]
108 FILENAMECHAR1 [_a-zA-Z\/\.\\\$\_\~]
109 SYMBOLCHARN [_a-zA-Z\/\.\\\$\_\~0-9]
110 FILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\=\$\:\[\]\\\,\~]
111 WILDCHAR [_a-zA-Z0-9\/\.\-\_\+\=\$\:\[\]\\\,\~\?\*]
114 NOCFILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\$\:\[\]\\\~]
116 V_TAG [.$_a-zA-Z][._a-zA-Z0-9]*
117 V_IDENTIFIER [*?.$_a-zA-Z][*?_a-zA-Z0-9]*
129 if (parser_input != input_selected)
131 /* The first token of the input determines the initial parser state. */
132 input_type t = parser_input;
133 parser_input = input_selected;
136 case input_script: return INPUT_SCRIPT; break;
137 case input_mri_script: return INPUT_MRI_SCRIPT; break;
138 case input_version_script: return INPUT_VERSION_SCRIPT; break;
139 case input_defsym: return INPUT_DEFSYM; break;
144 <BOTH,SCRIPT,EXPRESSION>"/*" { comment(); }
147 <DEFSYMEXP>"-" { RTOKEN('-');}
148 <DEFSYMEXP>"+" { RTOKEN('+');}
149 <DEFSYMEXP>{FILENAMECHAR1}{SYMBOLCHARN}* { yylval.name = buystring(yytext); return NAME; }
150 <DEFSYMEXP>"=" { RTOKEN('='); }
152 <MRI,EXPRESSION>"$"([0-9A-Fa-f])+ {
153 yylval.integer = bfd_scan_vma (yytext+1, 0,16);
157 <MRI,EXPRESSION>([0-9A-Fa-f])+(H|h|X|x|B|b|O|o|D|d) {
159 switch (yytext[yyleng-1]) {
177 yylval.integer = bfd_scan_vma (yytext, 0,
181 <SCRIPT,DEFSYMEXP,MRI,BOTH,EXPRESSION>((("$"|"0x")([0-9A-Fa-f])+)|(([0-9])+))(M|K|m|k)? {
186 yylval.integer = bfd_scan_vma (s, 0, 0);
187 if (yytext[yyleng-1] == 'M'
188 || yytext[yyleng-1] == 'm')
189 yylval.integer *= 1024 * 1024;
190 if (yytext[yyleng-1] == 'K'
191 || yytext[yyleng-1]=='k')
192 yylval.integer *= 1024;
195 <BOTH,SCRIPT,EXPRESSION,MRI>"]" { RTOKEN(']');}
196 <BOTH,SCRIPT,EXPRESSION,MRI>"[" { RTOKEN('[');}
197 <BOTH,SCRIPT,EXPRESSION,MRI>"<<=" { RTOKEN(LSHIFTEQ);}
198 <BOTH,SCRIPT,EXPRESSION,MRI>">>=" { RTOKEN(RSHIFTEQ);}
199 <BOTH,SCRIPT,EXPRESSION,MRI>"||" { RTOKEN(OROR);}
200 <BOTH,SCRIPT,EXPRESSION,MRI>"==" { RTOKEN(EQ);}
201 <BOTH,SCRIPT,EXPRESSION,MRI>"!=" { RTOKEN(NE);}
202 <BOTH,SCRIPT,EXPRESSION,MRI>">=" { RTOKEN(GE);}
203 <BOTH,SCRIPT,EXPRESSION,MRI>"<=" { RTOKEN(LE);}
204 <BOTH,SCRIPT,EXPRESSION,MRI>"<<" { RTOKEN(LSHIFT);}
205 <BOTH,SCRIPT,EXPRESSION,MRI>">>" { RTOKEN(RSHIFT);}
206 <BOTH,SCRIPT,EXPRESSION,MRI>"+=" { RTOKEN(PLUSEQ);}
207 <BOTH,SCRIPT,EXPRESSION,MRI>"-=" { RTOKEN(MINUSEQ);}
208 <BOTH,SCRIPT,EXPRESSION,MRI>"*=" { RTOKEN(MULTEQ);}
209 <BOTH,SCRIPT,EXPRESSION,MRI>"/=" { RTOKEN(DIVEQ);}
210 <BOTH,SCRIPT,EXPRESSION,MRI>"&=" { RTOKEN(ANDEQ);}
211 <BOTH,SCRIPT,EXPRESSION,MRI>"|=" { RTOKEN(OREQ);}
212 <BOTH,SCRIPT,EXPRESSION,MRI>"&&" { RTOKEN(ANDAND);}
213 <BOTH,SCRIPT,EXPRESSION,MRI>">" { RTOKEN('>');}
214 <BOTH,SCRIPT,EXPRESSION,MRI>"," { RTOKEN(',');}
215 <BOTH,SCRIPT,EXPRESSION,MRI>"&" { RTOKEN('&');}
216 <BOTH,SCRIPT,EXPRESSION,MRI>"|" { RTOKEN('|');}
217 <BOTH,SCRIPT,EXPRESSION,MRI>"~" { RTOKEN('~');}
218 <BOTH,SCRIPT,EXPRESSION,MRI>"!" { RTOKEN('!');}
219 <BOTH,SCRIPT,EXPRESSION,MRI>"?" { RTOKEN('?');}
220 <BOTH,SCRIPT,EXPRESSION,MRI>"*" { RTOKEN('*');}
221 <BOTH,SCRIPT,EXPRESSION,MRI>"+" { RTOKEN('+');}
222 <BOTH,SCRIPT,EXPRESSION,MRI>"-" { RTOKEN('-');}
223 <BOTH,SCRIPT,EXPRESSION,MRI>"/" { RTOKEN('/');}
224 <BOTH,SCRIPT,EXPRESSION,MRI>"%" { RTOKEN('%');}
225 <BOTH,SCRIPT,EXPRESSION,MRI>"<" { RTOKEN('<');}
226 <BOTH,SCRIPT,EXPRESSION,MRI>"=" { RTOKEN('=');}
227 <BOTH,SCRIPT,EXPRESSION,MRI>"}" { RTOKEN('}') ; }
228 <BOTH,SCRIPT,EXPRESSION,MRI>"{" { RTOKEN('{'); }
229 <BOTH,SCRIPT,EXPRESSION,MRI>")" { RTOKEN(')');}
230 <BOTH,SCRIPT,EXPRESSION,MRI>"(" { RTOKEN('(');}
231 <BOTH,SCRIPT,EXPRESSION,MRI>":" { RTOKEN(':'); }
232 <BOTH,SCRIPT,EXPRESSION,MRI>";" { RTOKEN(';');}
233 <BOTH,SCRIPT>"MEMORY" { RTOKEN(MEMORY);}
234 <BOTH,SCRIPT>"ORIGIN" { RTOKEN(ORIGIN);}
235 <BOTH,SCRIPT>"VERSION" { RTOKEN(VERSIONK);}
236 <EXPRESSION,BOTH,SCRIPT>"BLOCK" { RTOKEN(BLOCK);}
237 <EXPRESSION,BOTH,SCRIPT>"BIND" { RTOKEN(BIND);}
238 <BOTH,SCRIPT>"LENGTH" { RTOKEN(LENGTH);}
239 <EXPRESSION,BOTH,SCRIPT>"ALIGN" { RTOKEN(ALIGN_K);}
240 <EXPRESSION,BOTH,SCRIPT>"ADDR" { RTOKEN(ADDR);}
241 <EXPRESSION,BOTH,SCRIPT>"LOADADDR" { RTOKEN(LOADADDR);}
242 <EXPRESSION,BOTH>"MAX" { RTOKEN(MAX_K); }
243 <EXPRESSION,BOTH>"MIN" { RTOKEN(MIN_K); }
244 <BOTH,SCRIPT>"ENTRY" { RTOKEN(ENTRY);}
245 <BOTH,SCRIPT,MRI>"EXTERN" { RTOKEN(EXTERN);}
246 <EXPRESSION,BOTH,SCRIPT>"NEXT" { RTOKEN(NEXT);}
247 <EXPRESSION,BOTH,SCRIPT>"sizeof_headers" { RTOKEN(SIZEOF_HEADERS);}
248 <EXPRESSION,BOTH,SCRIPT>"SIZEOF_HEADERS" { RTOKEN(SIZEOF_HEADERS);}
249 <BOTH,SCRIPT>"MAP" { RTOKEN(MAP);}
250 <EXPRESSION,BOTH,SCRIPT>"SIZEOF" { RTOKEN(SIZEOF);}
251 <BOTH,SCRIPT>"TARGET" { RTOKEN(TARGET_K);}
252 <BOTH,SCRIPT>"SEARCH_DIR" { RTOKEN(SEARCH_DIR);}
253 <BOTH,SCRIPT>"OUTPUT" { RTOKEN(OUTPUT);}
254 <BOTH,SCRIPT>"INPUT" { RTOKEN(INPUT);}
255 <EXPRESSION,BOTH,SCRIPT>"GROUP" { RTOKEN(GROUP);}
256 <EXPRESSION,BOTH,SCRIPT>"DEFINED" { RTOKEN(DEFINED);}
257 <BOTH,SCRIPT>"CREATE_OBJECT_SYMBOLS" { RTOKEN(CREATE_OBJECT_SYMBOLS);}
258 <BOTH,SCRIPT>"CONSTRUCTORS" { RTOKEN( CONSTRUCTORS);}
259 <BOTH,SCRIPT>"FORCE_COMMON_ALLOCATION" { RTOKEN(FORCE_COMMON_ALLOCATION);}
260 <BOTH,SCRIPT>"SECTIONS" { RTOKEN(SECTIONS);}
261 <BOTH,SCRIPT>"FILL" { RTOKEN(FILL);}
262 <BOTH,SCRIPT>"STARTUP" { RTOKEN(STARTUP);}
263 <BOTH,SCRIPT>"OUTPUT_FORMAT" { RTOKEN(OUTPUT_FORMAT);}
264 <BOTH,SCRIPT>"OUTPUT_ARCH" { RTOKEN( OUTPUT_ARCH);}
265 <BOTH,SCRIPT>"HLL" { RTOKEN(HLL);}
266 <BOTH,SCRIPT>"SYSLIB" { RTOKEN(SYSLIB);}
267 <BOTH,SCRIPT>"FLOAT" { RTOKEN(FLOAT);}
268 <BOTH,SCRIPT>"QUAD" { RTOKEN( QUAD);}
269 <BOTH,SCRIPT>"SQUAD" { RTOKEN( SQUAD);}
270 <BOTH,SCRIPT>"LONG" { RTOKEN( LONG);}
271 <BOTH,SCRIPT>"SHORT" { RTOKEN( SHORT);}
272 <BOTH,SCRIPT>"BYTE" { RTOKEN( BYTE);}
273 <BOTH,SCRIPT>"NOFLOAT" { RTOKEN(NOFLOAT);}
274 <EXPRESSION,BOTH,SCRIPT>"NOCROSSREFS" { RTOKEN(NOCROSSREFS);}
275 <BOTH,SCRIPT>"OVERLAY" { RTOKEN(OVERLAY); }
276 <BOTH,SCRIPT>"SORT" { RTOKEN(SORT); }
277 <EXPRESSION,BOTH,SCRIPT>"NOLOAD" { RTOKEN(NOLOAD);}
278 <EXPRESSION,BOTH,SCRIPT>"DSECT" { RTOKEN(DSECT);}
279 <EXPRESSION,BOTH,SCRIPT>"COPY" { RTOKEN(COPY);}
280 <EXPRESSION,BOTH,SCRIPT>"INFO" { RTOKEN(INFO);}
281 <EXPRESSION,BOTH,SCRIPT>"OVERLAY" { RTOKEN(OVERLAY);}
282 <BOTH,SCRIPT>"o" { RTOKEN(ORIGIN);}
283 <BOTH,SCRIPT>"org" { RTOKEN(ORIGIN);}
284 <BOTH,SCRIPT>"l" { RTOKEN( LENGTH);}
285 <BOTH,SCRIPT>"len" { RTOKEN( LENGTH);}
286 <BOTH,SCRIPT>"INCLUDE" { RTOKEN(INCLUDE);}
287 <BOTH,SCRIPT>"PHDRS" { RTOKEN (PHDRS); }
288 <EXPRESSION,BOTH,SCRIPT>"AT" { RTOKEN(AT);}
289 <EXPRESSION,BOTH,SCRIPT>"PROVIDE" { RTOKEN(PROVIDE); }
290 <EXPRESSION,BOTH,SCRIPT>"KEEP" { RTOKEN(KEEP); }
291 <MRI>"#".*\n? { ++ lineno; }
292 <MRI>"\n" { ++ lineno; RTOKEN(NEWLINE); }
293 <MRI>"*".* { /* Mri comment line */ }
294 <MRI>";".* { /* Mri comment line */ }
295 <MRI>"END" { RTOKEN(ENDWORD); }
296 <MRI>"ALIGNMOD" { RTOKEN(ALIGNMOD);}
297 <MRI>"ALIGN" { RTOKEN(ALIGN_K);}
298 <MRI>"CHIP" { RTOKEN(CHIP); }
299 <MRI>"BASE" { RTOKEN(BASE); }
300 <MRI>"ALIAS" { RTOKEN(ALIAS); }
301 <MRI>"TRUNCATE" { RTOKEN(TRUNCATE); }
302 <MRI>"LOAD" { RTOKEN(LOAD); }
303 <MRI>"PUBLIC" { RTOKEN(PUBLIC); }
304 <MRI>"ORDER" { RTOKEN(ORDER); }
305 <MRI>"NAME" { RTOKEN(NAMEWORD); }
306 <MRI>"FORMAT" { RTOKEN(FORMAT); }
307 <MRI>"CASE" { RTOKEN(CASE); }
308 <MRI>"START" { RTOKEN(START); }
309 <MRI>"LIST".* { RTOKEN(LIST); /* LIST and ignore to end of line */ }
310 <MRI>"SECT" { RTOKEN(SECT); }
311 <EXPRESSION,BOTH,SCRIPT,MRI>"ABSOLUTE" { RTOKEN(ABSOLUTE); }
312 <MRI>"end" { RTOKEN(ENDWORD); }
313 <MRI>"alignmod" { RTOKEN(ALIGNMOD);}
314 <MRI>"align" { RTOKEN(ALIGN_K);}
315 <MRI>"chip" { RTOKEN(CHIP); }
316 <MRI>"base" { RTOKEN(BASE); }
317 <MRI>"alias" { RTOKEN(ALIAS); }
318 <MRI>"truncate" { RTOKEN(TRUNCATE); }
319 <MRI>"load" { RTOKEN(LOAD); }
320 <MRI>"public" { RTOKEN(PUBLIC); }
321 <MRI>"order" { RTOKEN(ORDER); }
322 <MRI>"name" { RTOKEN(NAMEWORD); }
323 <MRI>"format" { RTOKEN(FORMAT); }
324 <MRI>"case" { RTOKEN(CASE); }
325 <MRI>"extern" { RTOKEN(EXTERN); }
326 <MRI>"start" { RTOKEN(START); }
327 <MRI>"list".* { RTOKEN(LIST); /* LIST and ignore to end of line */ }
328 <MRI>"sect" { RTOKEN(SECT); }
329 <EXPRESSION,BOTH,SCRIPT,MRI>"absolute" { RTOKEN(ABSOLUTE); }
331 <MRI>{FILENAMECHAR1}{NOCFILENAMECHAR}* {
332 /* Filename without commas, needed to parse mri stuff */
333 yylval.name = buystring(yytext);
338 <BOTH,EXPRESSION>{FILENAMECHAR1}{FILENAMECHAR}* {
339 yylval.name = buystring(yytext);
342 <BOTH,EXPRESSION>"-l"{FILENAMECHAR}+ {
343 yylval.name = buystring (yytext + 2);
346 <SCRIPT>{WILDCHAR}* {
347 /* Annoyingly, this pattern can match comments, and we have
348 longest match issues to consider. So if the first two
349 characters are a comment opening, put the input back and
351 if (yytext[0] == '/' && yytext[1] == '*')
358 yylval.name = buystring(yytext);
363 <EXPRESSION,BOTH,SCRIPT>"\""[^\"]*"\"" {
364 /* No matter the state, quotes
365 give what's inside */
366 yylval.name = buystring(yytext+1);
367 yylval.name[yyleng-2] = 0;
370 <BOTH,SCRIPT,EXPRESSION>"\n" { lineno++;}
371 <MRI,BOTH,SCRIPT,EXPRESSION>[ \t\r]+ { }
373 <VERS_NODE,VERS_SCRIPT>[:,;] { return *yytext; }
375 <VERS_NODE>global { RTOKEN(GLOBAL); }
377 <VERS_NODE>local { RTOKEN(LOCAL); }
379 <VERS_NODE>{V_IDENTIFIER} { yylval.name = buystring (yytext);
380 return VERS_IDENTIFIER; }
382 <VERS_SCRIPT>{V_TAG} { yylval.name = buystring (yytext);
385 <VERS_START>"{" { BEGIN(VERS_SCRIPT); return *yytext; }
387 <VERS_SCRIPT>"{" { BEGIN(VERS_NODE); return *yytext; }
388 <VERS_SCRIPT,VERS_NODE>"}" { BEGIN(VERS_SCRIPT); return *yytext; }
390 <VERS_START,VERS_NODE,VERS_SCRIPT>[\n] { lineno++; }
392 <VERS_START,VERS_NODE,VERS_SCRIPT>#.* { /* Eat up comments */ }
394 <VERS_START,VERS_NODE,VERS_SCRIPT>[ \t\r]+ { /* Eat up whitespace */ }
399 if (include_stack_ptr == 0)
405 yy_switch_to_buffer(include_stack[include_stack_ptr]);
409 ldfile_input_filename = file_name_stack[include_stack_ptr - 1];
410 lineno = lineno_stack[include_stack_ptr - 1];
415 <SCRIPT,MRI,VERS_START,VERS_SCRIPT,VERS_NODE>. lex_warn_invalid(" in script", yytext);
416 <EXPRESSION,DEFSYMEXP,BOTH>. lex_warn_invalid(" in expression", yytext);
421 /* Switch flex to reading script file NAME, open on FILE,
422 saving the current input info on the include stack. */
425 lex_push_file (file, name)
429 if (include_stack_ptr >= MAX_INCLUDE_DEPTH)
431 einfo("%F:includes nested too deeply\n");
433 file_name_stack[include_stack_ptr] = name;
434 lineno_stack[include_stack_ptr] = 1;
435 include_stack[include_stack_ptr] = YY_CURRENT_BUFFER;
439 yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));
443 /* Return a newly created flex input buffer containing STRING,
444 which is SIZE bytes long. */
446 static YY_BUFFER_STATE
447 yy_create_string_buffer (string, size)
453 /* Calls to m-alloc get turned by sed into xm-alloc. */
454 b = (YY_BUFFER_STATE) malloc (sizeof (struct yy_buffer_state));
455 b->yy_input_file = 0;
456 b->yy_buf_size = size;
458 /* yy_ch_buf has to be 2 characters longer than the size given because
459 we need to put in 2 end-of-buffer characters. */
460 b->yy_ch_buf = (char *) malloc ((unsigned) (b->yy_buf_size + 3));
462 b->yy_ch_buf[0] = '\n';
463 strcpy (b->yy_ch_buf+1, string);
464 b->yy_ch_buf[size+1] = YY_END_OF_BUFFER_CHAR;
465 b->yy_ch_buf[size+2] = YY_END_OF_BUFFER_CHAR;
466 b->yy_n_chars = size+1;
467 b->yy_buf_pos = &b->yy_ch_buf[1];
469 /* flex 2.4.7 changed the interface. FIXME: We should not be using
470 a flex internal interface in the first place! */
472 b->yy_buffer_status = YY_BUFFER_NEW;
474 b->yy_eof_status = EOF_NOT_SEEN;
480 /* Switch flex to reading from STRING, saving the current input info
481 on the include stack. */
484 lex_redirect (string)
490 if (include_stack_ptr >= MAX_INCLUDE_DEPTH)
492 einfo("%F: macros nested too deeply\n");
494 file_name_stack[include_stack_ptr] = "redirect";
495 lineno_stack[include_stack_ptr] = 0;
496 include_stack[include_stack_ptr] = YY_CURRENT_BUFFER;
498 tmp = yy_create_string_buffer (string, strlen (string));
499 yy_switch_to_buffer (tmp);
503 /* Functions to switch to a different flex start condition,
504 saving the current start condition on `state_stack'. */
506 static int state_stack[MAX_INCLUDE_DEPTH * 2];
507 static int *state_stack_p = state_stack;
512 *(state_stack_p)++ = yy_start;
519 *(state_stack_p)++ = yy_start;
524 ldlex_version_script ()
526 *(state_stack_p)++ = yy_start;
531 ldlex_version_file ()
533 *(state_stack_p)++ = yy_start;
540 *(state_stack_p)++ = yy_start;
547 *(state_stack_p)++ = yy_start;
554 *(state_stack_p)++ = yy_start;
561 yy_start = *(--state_stack_p);
565 /* Place up to MAX_SIZE characters in BUF and return in *RESULT
566 either the number of characters read, or 0 to indicate EOF. */
569 yy_input (buf, result, max_size)
575 if (yy_current_buffer->yy_input_file)
579 *result = read (fileno (yyin), (char *) buf, max_size);
581 einfo ("%F%P: read in flex scanner failed\n");
586 /* Eat the rest of a C-style comment. */
596 while (c != '*' && c != EOF)
609 break; /* found the end */
617 einfo( "%F%P: EOF in comment\n");
623 /* Warn the user about a garbage character WHAT in the input
627 lex_warn_invalid (where, what)
632 /* If we have found an input file whose format we do not recognize,
633 and we are therefore treating it as a linker script, and we find
634 an invalid character, then most likely this is a real object file
635 of some different format. Treat it as such. */
636 if (ldfile_assumed_script)
638 bfd_set_error (bfd_error_file_not_recognized);
639 einfo ("%F%s: file not recognized: %E\n", ldfile_input_filename);
642 if (! isprint ((unsigned char) *what))
644 sprintf (buf, "\\%03o", (unsigned int) *what);
648 einfo ("%P:%S: ignoring invalid character `%s'%s\n", what, where);