3 /* Copyright (C) 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
5 This file is part of GLD, the Gnu Linker.
7 GLD is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
12 GLD is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GLD; see the file COPYING. If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
22 This was written by steve chamberlain
32 /* Prevent enum redefinition problems. */
33 #define TRUE_FALSE_ALREADY_DEFINED
47 /* The type of top-level parser input.
48 yylex and yyparse (indirectly) both check this. */
49 input_type parser_input;
51 /* Radix to use for bfd_scan_vma -- 0 (default to base 10) or 16. */
54 /* Line number in the current input file.
55 (FIXME Actually, it doesn't appear to get reset for each file?) */
56 unsigned int lineno = 1;
58 /* The string we are currently lexing, or NULL if we are reading a
60 const char *lex_string = NULL;
62 /* Support for flex reading from more than one input file (stream).
63 `include_stack' is flex's input state for each open file;
64 `file_name_stack' is the file names. `lineno_stack' is the current
67 If `include_stack_ptr' is 0, we haven't started reading anything yet.
68 Otherwise, stack elements 0 through `include_stack_ptr - 1' are valid. */
71 #define YY_INPUT(buf,result,max_size) yy_input(buf, &result, max_size)
73 #define MAX_INCLUDE_DEPTH 10
74 static YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
75 static const char *file_name_stack[MAX_INCLUDE_DEPTH];
76 static unsigned int lineno_stack[MAX_INCLUDE_DEPTH];
77 static unsigned int include_stack_ptr = 0;
79 static YY_BUFFER_STATE yy_create_string_buffer PARAMS ((const char *string,
81 static void yy_input PARAMS ((char *, int *result, int max_size));
83 static void comment PARAMS ((void));
84 static void lex_warn_invalid PARAMS ((char *where, char *what));
87 EXPRESSION definitely in an expression
88 SCRIPT definitely in a script
89 BOTH either EXPRESSION or SCRIPT
90 DEFSYMEXP in an argument to -defsym
92 VERS_START starting a Sun style mapfile
93 VERS_SCRIPT a Sun style mapfile
94 VERS_NODE a node within a Sun style mapfile
96 #define RTOKEN(x) { yylval.token = x; return x; }
98 /* Some versions of flex want this. */
100 int yywrap () { return 1; }
107 CMDFILENAMECHAR [_a-zA-Z0-9\/\.\\_\+\$\:\[\]\\\,\=\&\!\<\>\-\~]
108 CMDFILENAMECHAR1 [_a-zA-Z0-9\/\.\\_\+\$\:\[\]\\\,\=\&\!\<\>\~]
109 FILENAMECHAR1 [_a-zA-Z\/\.\\\$\_\~]
110 SYMBOLCHARN [_a-zA-Z\/\.\\\$\_\~0-9]
111 FILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\=\$\:\[\]\\\,\~]
112 WILDCHAR [_a-zA-Z0-9\/\.\-\_\+\=\$\:\[\]\\\,\~\?\*]
115 NOCFILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\$\:\[\]\\\~]
117 V_TAG [.$_a-zA-Z][._a-zA-Z0-9]*
118 V_IDENTIFIER [*?$_a-zA-Z][*?_a-zA-Z0-9]*
130 if (parser_input != input_selected)
132 /* The first token of the input determines the initial parser state. */
133 input_type t = parser_input;
134 parser_input = input_selected;
137 case input_script: return INPUT_SCRIPT; break;
138 case input_mri_script: return INPUT_MRI_SCRIPT; break;
139 case input_version_script: return INPUT_VERSION_SCRIPT; break;
140 case input_defsym: return INPUT_DEFSYM; break;
145 <BOTH,SCRIPT,EXPRESSION>"/*" { comment(); }
148 <DEFSYMEXP>"-" { RTOKEN('-');}
149 <DEFSYMEXP>"+" { RTOKEN('+');}
150 <DEFSYMEXP>{FILENAMECHAR1}{SYMBOLCHARN}* { yylval.name = buystring(yytext); return NAME; }
151 <DEFSYMEXP>"=" { RTOKEN('='); }
153 <MRI,EXPRESSION>"$"([0-9A-Fa-f])+ {
154 yylval.integer = bfd_scan_vma (yytext+1, 0,16);
158 <MRI,EXPRESSION>([0-9A-Fa-f])+(H|h|X|x|B|b|O|o|D|d) {
160 switch (yytext[yyleng-1]) {
178 yylval.integer = bfd_scan_vma (yytext, 0,
182 <SCRIPT,DEFSYMEXP,MRI,BOTH,EXPRESSION>"$"?"0x"?([0-9A-Fa-f])+(M|K|m|k)? {
183 yylval.integer = bfd_scan_vma (yytext, 0,
185 if (yytext[yyleng-1]=='M'
186 || yytext[yyleng-1] == 'm') {
187 yylval.integer *= 1024*1024;
189 if (yytext[yyleng-1]=='K'
190 || yytext[yyleng-1]=='k') {
191 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(VERSION);}
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); }
243 <EXPRESSION,BOTH>"MIN" { RTOKEN(MIN); }
244 <BOTH,SCRIPT>"ENTRY" { RTOKEN(ENTRY);}
245 <EXPRESSION,BOTH,SCRIPT>"NEXT" { RTOKEN(NEXT);}
246 <EXPRESSION,BOTH,SCRIPT>"sizeof_headers" { RTOKEN(SIZEOF_HEADERS);}
247 <EXPRESSION,BOTH,SCRIPT>"SIZEOF_HEADERS" { RTOKEN(SIZEOF_HEADERS);}
248 <BOTH,SCRIPT>"MAP" { RTOKEN(MAP);}
249 <EXPRESSION,BOTH,SCRIPT>"SIZEOF" { RTOKEN(SIZEOF);}
250 <BOTH,SCRIPT>"TARGET" { RTOKEN(TARGET_K);}
251 <BOTH,SCRIPT>"SEARCH_DIR" { RTOKEN(SEARCH_DIR);}
252 <BOTH,SCRIPT>"OUTPUT" { RTOKEN(OUTPUT);}
253 <BOTH,SCRIPT>"INPUT" { RTOKEN(INPUT);}
254 <EXPRESSION,BOTH,SCRIPT>"GROUP" { RTOKEN(GROUP);}
255 <EXPRESSION,BOTH,SCRIPT>"DEFINED" { RTOKEN(DEFINED);}
256 <BOTH,SCRIPT>"CREATE_OBJECT_SYMBOLS" { RTOKEN(CREATE_OBJECT_SYMBOLS);}
257 <BOTH,SCRIPT>"CONSTRUCTORS" { RTOKEN( CONSTRUCTORS);}
258 <BOTH,SCRIPT>"FORCE_COMMON_ALLOCATION" { RTOKEN(FORCE_COMMON_ALLOCATION);}
259 <BOTH,SCRIPT>"SECTIONS" { RTOKEN(SECTIONS);}
260 <BOTH,SCRIPT>"FILL" { RTOKEN(FILL);}
261 <BOTH,SCRIPT>"STARTUP" { RTOKEN(STARTUP);}
262 <BOTH,SCRIPT>"OUTPUT_FORMAT" { RTOKEN(OUTPUT_FORMAT);}
263 <BOTH,SCRIPT>"OUTPUT_ARCH" { RTOKEN( OUTPUT_ARCH);}
264 <BOTH,SCRIPT>"HLL" { RTOKEN(HLL);}
265 <BOTH,SCRIPT>"SYSLIB" { RTOKEN(SYSLIB);}
266 <BOTH,SCRIPT>"FLOAT" { RTOKEN(FLOAT);}
267 <BOTH,SCRIPT>"QUAD" { RTOKEN( QUAD);}
268 <BOTH,SCRIPT>"SQUAD" { RTOKEN( SQUAD);}
269 <BOTH,SCRIPT>"LONG" { RTOKEN( LONG);}
270 <BOTH,SCRIPT>"SHORT" { RTOKEN( SHORT);}
271 <BOTH,SCRIPT>"BYTE" { RTOKEN( BYTE);}
272 <BOTH,SCRIPT>"NOFLOAT" { RTOKEN(NOFLOAT);}
273 <EXPRESSION,BOTH,SCRIPT>"NOCROSSREFS" { RTOKEN(NOCROSSREFS);}
274 <BOTH,SCRIPT>"OVERLAY" { RTOKEN(OVERLAY); }
275 <EXPRESSION,BOTH,SCRIPT>"NOLOAD" { RTOKEN(NOLOAD);}
276 <EXPRESSION,BOTH,SCRIPT>"DSECT" { RTOKEN(DSECT);}
277 <EXPRESSION,BOTH,SCRIPT>"COPY" { RTOKEN(COPY);}
278 <EXPRESSION,BOTH,SCRIPT>"INFO" { RTOKEN(INFO);}
279 <EXPRESSION,BOTH,SCRIPT>"OVERLAY" { RTOKEN(OVERLAY);}
280 <BOTH,SCRIPT>"o" { RTOKEN(ORIGIN);}
281 <BOTH,SCRIPT>"org" { RTOKEN(ORIGIN);}
282 <BOTH,SCRIPT>"l" { RTOKEN( LENGTH);}
283 <BOTH,SCRIPT>"len" { RTOKEN( LENGTH);}
284 <BOTH,SCRIPT>"INCLUDE" { RTOKEN(INCLUDE);}
285 <BOTH,SCRIPT>"PHDRS" { RTOKEN (PHDRS); }
286 <EXPRESSION,BOTH,SCRIPT>"AT" { RTOKEN(AT);}
287 <EXPRESSION,BOTH,SCRIPT>"PROVIDE" { RTOKEN(PROVIDE); }
288 <MRI>"#".*\n?\r? { ++ lineno; }
289 <MRI>"\n" { ++ lineno; RTOKEN(NEWLINE); }
290 <MRI>"\r" { ++ lineno; RTOKEN(NEWLINE); }
291 <MRI>"*".* { /* Mri comment line */ }
292 <MRI>";".* { /* Mri comment line */ }
293 <MRI>"END" { RTOKEN(ENDWORD); }
294 <MRI>"ALIGNMOD" { RTOKEN(ALIGNMOD);}
295 <MRI>"ALIGN" { RTOKEN(ALIGN_K);}
296 <MRI>"CHIP" { RTOKEN(CHIP); }
297 <MRI>"BASE" { RTOKEN(BASE); }
298 <MRI>"ALIAS" { RTOKEN(ALIAS); }
299 <MRI>"TRUNCATE" { RTOKEN(TRUNCATE); }
300 <MRI>"LOAD" { RTOKEN(LOAD); }
301 <MRI>"PUBLIC" { RTOKEN(PUBLIC); }
302 <MRI>"ORDER" { RTOKEN(ORDER); }
303 <MRI>"NAME" { RTOKEN(NAMEWORD); }
304 <MRI>"FORMAT" { RTOKEN(FORMAT); }
305 <MRI>"CASE" { RTOKEN(CASE); }
306 <MRI>"EXTERN" { RTOKEN(EXTERN); }
307 <MRI>"START" { RTOKEN(START); }
308 <MRI>"LIST".* { RTOKEN(LIST); /* LIST and ignore to end of line */ }
309 <MRI>"SECT" { RTOKEN(SECT); }
310 <EXPRESSION,BOTH,SCRIPT,MRI>"ABSOLUTE" { RTOKEN(ABSOLUTE); }
311 <MRI>"end" { RTOKEN(ENDWORD); }
312 <MRI>"alignmod" { RTOKEN(ALIGNMOD);}
313 <MRI>"align" { RTOKEN(ALIGN_K);}
314 <MRI>"chip" { RTOKEN(CHIP); }
315 <MRI>"base" { RTOKEN(BASE); }
316 <MRI>"alias" { RTOKEN(ALIAS); }
317 <MRI>"truncate" { RTOKEN(TRUNCATE); }
318 <MRI>"load" { RTOKEN(LOAD); }
319 <MRI>"public" { RTOKEN(PUBLIC); }
320 <MRI>"order" { RTOKEN(ORDER); }
321 <MRI>"name" { RTOKEN(NAMEWORD); }
322 <MRI>"format" { RTOKEN(FORMAT); }
323 <MRI>"case" { RTOKEN(CASE); }
324 <MRI>"extern" { RTOKEN(EXTERN); }
325 <MRI>"start" { RTOKEN(START); }
326 <MRI>"list".* { RTOKEN(LIST); /* LIST and ignore to end of line */ }
327 <MRI>"sect" { RTOKEN(SECT); }
328 <EXPRESSION,BOTH,SCRIPT,MRI>"absolute" { RTOKEN(ABSOLUTE); }
330 <MRI>{FILENAMECHAR1}{NOCFILENAMECHAR}* {
331 /* Filename without commas, needed to parse mri stuff */
332 yylval.name = buystring(yytext);
337 <BOTH,EXPRESSION>{FILENAMECHAR1}{FILENAMECHAR}* {
338 yylval.name = buystring(yytext);
341 <BOTH,EXPRESSION>"-l"{FILENAMECHAR}+ {
342 yylval.name = buystring (yytext + 2);
345 <SCRIPT>{WILDCHAR}* { yylval.name = buystring(yytext); return NAME; }
347 <EXPRESSION,BOTH,SCRIPT>"\""[^\"]*"\"" {
348 /* No matter the state, quotes
349 give what's inside */
350 yylval.name = buystring(yytext+1);
351 yylval.name[yyleng-2] = 0;
354 <BOTH,SCRIPT,EXPRESSION>"\n" { lineno++;}
355 <BOTH,SCRIPT,EXPRESSION>"\r" { lineno++;}
356 <MRI,BOTH,SCRIPT,EXPRESSION>[ \t]
358 <VERS_NODE,VERS_SCRIPT>[:,;] { return *yytext; }
360 <VERS_NODE>global { RTOKEN(GLOBAL); }
362 <VERS_NODE>local { RTOKEN(LOCAL); }
364 <VERS_NODE>{V_IDENTIFIER} { yylval.name = buystring (yytext);
365 return VERS_IDENTIFIER; }
367 <VERS_SCRIPT>{V_TAG} { yylval.name = buystring (yytext);
370 <VERS_START>"{" { BEGIN(VERS_SCRIPT); return *yytext; }
372 <VERS_SCRIPT>"{" { BEGIN(VERS_NODE); return *yytext; }
373 <VERS_SCRIPT,VERS_NODE>"}" { BEGIN(VERS_SCRIPT); return *yytext; }
375 <VERS_START,VERS_NODE,VERS_SCRIPT>[\n\r] { lineno++; }
377 <VERS_START,VERS_NODE,VERS_SCRIPT>#.* { /* Eat up comments */ }
379 <VERS_START,VERS_NODE,VERS_SCRIPT>[ \t]+ { /* Eat up whitespace */ }
384 if (include_stack_ptr == 0)
390 yy_switch_to_buffer(include_stack[include_stack_ptr]);
394 ldfile_input_filename = file_name_stack[include_stack_ptr - 1];
395 lineno = lineno_stack[include_stack_ptr - 1];
400 <SCRIPT,MRI,VERS_START,VERS_SCRIPT,VERS_NODE>. lex_warn_invalid(" in script", yytext);
401 <EXPRESSION,DEFSYMEXP,BOTH>. lex_warn_invalid(" in expression", yytext);
406 /* Switch flex to reading script file NAME, open on FILE,
407 saving the current input info on the include stack. */
410 lex_push_file (file, name)
414 if (include_stack_ptr >= MAX_INCLUDE_DEPTH)
416 einfo("%F:includes nested too deeply\n");
418 file_name_stack[include_stack_ptr] = name;
419 lineno_stack[include_stack_ptr] = 1;
420 include_stack[include_stack_ptr] = YY_CURRENT_BUFFER;
424 yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));
428 /* Return a newly created flex input buffer containing STRING,
429 which is SIZE bytes long. */
431 static YY_BUFFER_STATE
432 yy_create_string_buffer (string, size)
438 /* Calls to m-alloc get turned by sed into xm-alloc. */
439 b = (YY_BUFFER_STATE) malloc (sizeof (struct yy_buffer_state));
440 b->yy_input_file = 0;
441 b->yy_buf_size = size;
443 /* yy_ch_buf has to be 2 characters longer than the size given because
444 we need to put in 2 end-of-buffer characters. */
445 b->yy_ch_buf = (char *) malloc ((unsigned) (b->yy_buf_size + 3));
447 b->yy_ch_buf[0] = '\n';
448 strcpy (b->yy_ch_buf+1, string);
449 b->yy_ch_buf[size+1] = YY_END_OF_BUFFER_CHAR;
450 b->yy_ch_buf[size+2] = YY_END_OF_BUFFER_CHAR;
451 b->yy_n_chars = size+1;
452 b->yy_buf_pos = &b->yy_ch_buf[1];
454 /* flex 2.4.7 changed the interface. FIXME: We should not be using
455 a flex internal interface in the first place! */
457 b->yy_buffer_status = YY_BUFFER_NEW;
459 b->yy_eof_status = EOF_NOT_SEEN;
465 /* Switch flex to reading from STRING, saving the current input info
466 on the include stack. */
469 lex_redirect (string)
475 if (include_stack_ptr >= MAX_INCLUDE_DEPTH)
477 einfo("%F: macros nested too deeply\n");
479 file_name_stack[include_stack_ptr] = "redirect";
480 lineno_stack[include_stack_ptr] = 0;
481 include_stack[include_stack_ptr] = YY_CURRENT_BUFFER;
483 tmp = yy_create_string_buffer (string, strlen (string));
484 yy_switch_to_buffer (tmp);
488 /* Functions to switch to a different flex start condition,
489 saving the current start condition on `state_stack'. */
491 static int state_stack[MAX_INCLUDE_DEPTH * 2];
492 static int *state_stack_p = state_stack;
497 *(state_stack_p)++ = yy_start;
504 *(state_stack_p)++ = yy_start;
509 ldlex_version_script ()
511 *(state_stack_p)++ = yy_start;
516 ldlex_version_file ()
518 *(state_stack_p)++ = yy_start;
525 *(state_stack_p)++ = yy_start;
532 *(state_stack_p)++ = yy_start;
539 *(state_stack_p)++ = yy_start;
546 yy_start = *(--state_stack_p);
550 /* Place up to MAX_SIZE characters in BUF and return in *RESULT
551 either the number of characters read, or 0 to indicate EOF. */
554 yy_input (buf, result, max_size)
560 if (yy_current_buffer->yy_input_file)
564 *result = read (fileno (yyin), (char *) buf, max_size);
566 einfo ("%F%P: read in flex scanner failed\n");
571 /* Eat the rest of a C-style comment. */
581 while (c != '*' && c != EOF)
583 if (c == '\n' || c == '\r')
594 break; /* found the end */
597 if (c == '\n' || c == '\r')
602 einfo( "%F%P: EOF in comment\n");
608 /* Warn the user about a garbage character WHAT in the input
612 lex_warn_invalid (where, what)
617 /* If we have found an input file whose format we do not recognize,
618 and we are therefore treating it as a linker script, and we find
619 an invalid character, then most likely this is a real object file
620 of some different format. Treat it as such. */
621 if (ldfile_assumed_script)
623 bfd_set_error (bfd_error_file_not_recognized);
624 einfo ("%F%s: file not recognized: %E\n", ldfile_input_filename);
627 if (! isprint ((unsigned char) *what))
629 sprintf (buf, "\\%03o", (unsigned int) *what);
633 einfo ("%P:%S: ignoring invalid character `%s'%s\n", what, where);