tlink.c (52750) | tlink.c (90075) |
---|---|
1/* Scan linker error messages for missing template instantiations and provide 2 them. 3 | 1/* Scan linker error messages for missing template instantiations and provide 2 them. 3 |
4 Copyright (C) 1995, 1998 Free Software Foundation, Inc. | 4 Copyright (C) 1995, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. |
5 Contributed by Jason Merrill (jason@cygnus.com). 6 | 5 Contributed by Jason Merrill (jason@cygnus.com). 6 |
7This file is part of GNU CC. | 7This file is part of GCC. |
8 | 8 |
9GNU CC is free software; you can redistribute it and/or modify 10it under the terms of the GNU General Public License as published by 11the Free Software Foundation; either version 2, or (at your option) 12any later version. | 9GCC is free software; you can redistribute it and/or modify it under 10the terms of the GNU General Public License as published by the Free 11Software Foundation; either version 2, or (at your option) any later 12version. |
13 | 13 |
14GNU CC is distributed in the hope that it will be useful, 15but WITHOUT ANY WARRANTY; without even the implied warranty of 16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17GNU General Public License for more details. | 14GCC is distributed in the hope that it will be useful, but WITHOUT ANY 15WARRANTY; without even the implied warranty of MERCHANTABILITY or 16FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 17for more details. |
18 19You should have received a copy of the GNU General Public License | 18 19You should have received a copy of the GNU General Public License |
20along with GNU CC; see the file COPYING. If not, write to 21the Free Software Foundation, 59 Temple Place - Suite 330, 22Boston, MA 02111-1307, USA. */ | 20along with GCC; see the file COPYING. If not, write to the Free 21Software Foundation, 59 Temple Place - Suite 330, Boston, MA 2202111-1307, USA. */ |
23 24#include "config.h" 25#include "system.h" | 23 24#include "config.h" 25#include "system.h" |
26#include "intl.h" |
|
26#include "hash.h" 27#include "demangle.h" | 27#include "hash.h" 28#include "demangle.h" |
28#include "toplev.h" | |
29#include "collect2.h" 30 31#define MAX_ITERATIONS 17 32 33/* Obstack allocation and deallocation routines. */ 34#define obstack_chunk_alloc xmalloc 35#define obstack_chunk_free free 36 | 29#include "collect2.h" 30 31#define MAX_ITERATIONS 17 32 33/* Obstack allocation and deallocation routines. */ 34#define obstack_chunk_alloc xmalloc 35#define obstack_chunk_free free 36 |
37/* Defined in collect2.c. */ 38extern int vflag, debug; 39extern char *ldout; 40extern char *c_file_name; 41extern struct obstack temporary_obstack; 42extern struct obstack permanent_obstack; 43extern char * temporary_firstobj; 44 | |
45/* Defined in the automatically-generated underscore.c. */ 46extern int prepends_underscore; 47 48static int tlink_verbose; 49 50/* Hash table boilerplate for working with hash.[ch]. We have hash tables 51 for symbol names, file names, and demangled symbols. */ 52 --- 22 unchanged lines hidden (view full) --- 75} demangled; 76 77static struct hash_table symbol_table; 78 79static struct hash_entry * symbol_hash_newfunc PARAMS ((struct hash_entry *, 80 struct hash_table *, 81 hash_table_key)); 82static struct symbol_hash_entry * symbol_hash_lookup PARAMS ((const char *, | 37/* Defined in the automatically-generated underscore.c. */ 38extern int prepends_underscore; 39 40static int tlink_verbose; 41 42/* Hash table boilerplate for working with hash.[ch]. We have hash tables 43 for symbol names, file names, and demangled symbols. */ 44 --- 22 unchanged lines hidden (view full) --- 67} demangled; 68 69static struct hash_table symbol_table; 70 71static struct hash_entry * symbol_hash_newfunc PARAMS ((struct hash_entry *, 72 struct hash_table *, 73 hash_table_key)); 74static struct symbol_hash_entry * symbol_hash_lookup PARAMS ((const char *, |
83 boolean)); | 75 int)); |
84static struct hash_entry * file_hash_newfunc PARAMS ((struct hash_entry *, 85 struct hash_table *, 86 hash_table_key)); 87static struct file_hash_entry * file_hash_lookup PARAMS ((const char *)); 88static struct hash_entry * demangled_hash_newfunc PARAMS ((struct hash_entry *, 89 struct hash_table *, 90 hash_table_key)); 91static struct demangled_hash_entry * | 76static struct hash_entry * file_hash_newfunc PARAMS ((struct hash_entry *, 77 struct hash_table *, 78 hash_table_key)); 79static struct file_hash_entry * file_hash_lookup PARAMS ((const char *)); 80static struct hash_entry * demangled_hash_newfunc PARAMS ((struct hash_entry *, 81 struct hash_table *, 82 hash_table_key)); 83static struct demangled_hash_entry * |
92 demangled_hash_lookup PARAMS ((const char *, boolean)); | 84 demangled_hash_lookup PARAMS ((const char *, int)); |
93static void symbol_push PARAMS ((symbol *)); 94static symbol * symbol_pop PARAMS ((void)); 95static void file_push PARAMS ((file *)); 96static file * file_pop PARAMS ((void)); 97static void tlink_init PARAMS ((void)); | 85static void symbol_push PARAMS ((symbol *)); 86static symbol * symbol_pop PARAMS ((void)); 87static void file_push PARAMS ((file *)); 88static file * file_pop PARAMS ((void)); 89static void tlink_init PARAMS ((void)); |
98static int tlink_execute PARAMS ((char *, char **, char *)); 99static char * frob_extension PARAMS ((char *, const char *)); | 90static int tlink_execute PARAMS ((const char *, char **, const char *)); 91static char * frob_extension PARAMS ((const char *, const char *)); |
100static char * obstack_fgets PARAMS ((FILE *, struct obstack *)); 101static char * tfgets PARAMS ((FILE *)); 102static char * pfgets PARAMS ((FILE *)); 103static void freadsym PARAMS ((FILE *, file *, int)); 104static void read_repo_file PARAMS ((file *)); 105static void maybe_tweak PARAMS ((char *, file *)); 106static int recompile_files PARAMS ((void)); 107static int read_repo_files PARAMS ((char **)); 108static void demangle_new_symbols PARAMS ((void)); 109static int scan_linker_output PARAMS ((const char *)); 110 111/* Create a new entry for the symbol hash table. 112 Passed to hash_table_init. */ 113 114static struct hash_entry * 115symbol_hash_newfunc (entry, table, string) 116 struct hash_entry *entry; 117 struct hash_table *table; | 92static char * obstack_fgets PARAMS ((FILE *, struct obstack *)); 93static char * tfgets PARAMS ((FILE *)); 94static char * pfgets PARAMS ((FILE *)); 95static void freadsym PARAMS ((FILE *, file *, int)); 96static void read_repo_file PARAMS ((file *)); 97static void maybe_tweak PARAMS ((char *, file *)); 98static int recompile_files PARAMS ((void)); 99static int read_repo_files PARAMS ((char **)); 100static void demangle_new_symbols PARAMS ((void)); 101static int scan_linker_output PARAMS ((const char *)); 102 103/* Create a new entry for the symbol hash table. 104 Passed to hash_table_init. */ 105 106static struct hash_entry * 107symbol_hash_newfunc (entry, table, string) 108 struct hash_entry *entry; 109 struct hash_table *table; |
118 hash_table_key string; | 110 hash_table_key string ATTRIBUTE_UNUSED; |
119{ 120 struct symbol_hash_entry *ret = (struct symbol_hash_entry *) entry; 121 if (ret == NULL) 122 { 123 ret = ((struct symbol_hash_entry *) 124 hash_allocate (table, sizeof (struct symbol_hash_entry))); 125 if (ret == NULL) 126 return NULL; --- 5 unchanged lines hidden (view full) --- 132 return (struct hash_entry *) ret; 133} 134 135/* Look up an entry in the symbol hash table. */ 136 137static struct symbol_hash_entry * 138symbol_hash_lookup (string, create) 139 const char *string; | 111{ 112 struct symbol_hash_entry *ret = (struct symbol_hash_entry *) entry; 113 if (ret == NULL) 114 { 115 ret = ((struct symbol_hash_entry *) 116 hash_allocate (table, sizeof (struct symbol_hash_entry))); 117 if (ret == NULL) 118 return NULL; --- 5 unchanged lines hidden (view full) --- 124 return (struct hash_entry *) ret; 125} 126 127/* Look up an entry in the symbol hash table. */ 128 129static struct symbol_hash_entry * 130symbol_hash_lookup (string, create) 131 const char *string; |
140 boolean create; | 132 int create; |
141{ 142 return ((struct symbol_hash_entry *) | 133{ 134 return ((struct symbol_hash_entry *) |
143 hash_lookup (&symbol_table, (hash_table_key) string, 144 create, &string_copy)); | 135 hash_lookup (&symbol_table, (const hash_table_key) string, 136 create, string_copy)); |
145} 146 147static struct hash_table file_table; 148 149/* Create a new entry for the file hash table. 150 Passed to hash_table_init. */ 151 152static struct hash_entry * 153file_hash_newfunc (entry, table, string) 154 struct hash_entry *entry; 155 struct hash_table *table; | 137} 138 139static struct hash_table file_table; 140 141/* Create a new entry for the file hash table. 142 Passed to hash_table_init. */ 143 144static struct hash_entry * 145file_hash_newfunc (entry, table, string) 146 struct hash_entry *entry; 147 struct hash_table *table; |
156 hash_table_key string; | 148 hash_table_key string ATTRIBUTE_UNUSED; |
157{ 158 struct file_hash_entry *ret = (struct file_hash_entry *) entry; 159 if (ret == NULL) 160 { 161 ret = ((struct file_hash_entry *) 162 hash_allocate (table, sizeof (struct file_hash_entry))); 163 if (ret == NULL) 164 return NULL; --- 7 unchanged lines hidden (view full) --- 172 173/* Look up an entry in the file hash table. */ 174 175static struct file_hash_entry * 176file_hash_lookup (string) 177 const char *string; 178{ 179 return ((struct file_hash_entry *) | 149{ 150 struct file_hash_entry *ret = (struct file_hash_entry *) entry; 151 if (ret == NULL) 152 { 153 ret = ((struct file_hash_entry *) 154 hash_allocate (table, sizeof (struct file_hash_entry))); 155 if (ret == NULL) 156 return NULL; --- 7 unchanged lines hidden (view full) --- 164 165/* Look up an entry in the file hash table. */ 166 167static struct file_hash_entry * 168file_hash_lookup (string) 169 const char *string; 170{ 171 return ((struct file_hash_entry *) |
180 hash_lookup (&file_table, (hash_table_key) string, true, 181 &string_copy)); | 172 hash_lookup (&file_table, (const hash_table_key) string, true, 173 string_copy)); |
182} 183 184static struct hash_table demangled_table; 185 186/* Create a new entry for the demangled name hash table. 187 Passed to hash_table_init. */ 188 189static struct hash_entry * 190demangled_hash_newfunc (entry, table, string) 191 struct hash_entry *entry; 192 struct hash_table *table; | 174} 175 176static struct hash_table demangled_table; 177 178/* Create a new entry for the demangled name hash table. 179 Passed to hash_table_init. */ 180 181static struct hash_entry * 182demangled_hash_newfunc (entry, table, string) 183 struct hash_entry *entry; 184 struct hash_table *table; |
193 hash_table_key string; | 185 hash_table_key string ATTRIBUTE_UNUSED; |
194{ 195 struct demangled_hash_entry *ret = (struct demangled_hash_entry *) entry; 196 if (ret == NULL) 197 { 198 ret = ((struct demangled_hash_entry *) 199 hash_allocate (table, sizeof (struct demangled_hash_entry))); 200 if (ret == NULL) 201 return NULL; 202 } 203 ret->mangled = NULL; 204 return (struct hash_entry *) ret; 205} 206 207/* Look up an entry in the demangled name hash table. */ 208 209static struct demangled_hash_entry * 210demangled_hash_lookup (string, create) 211 const char *string; | 186{ 187 struct demangled_hash_entry *ret = (struct demangled_hash_entry *) entry; 188 if (ret == NULL) 189 { 190 ret = ((struct demangled_hash_entry *) 191 hash_allocate (table, sizeof (struct demangled_hash_entry))); 192 if (ret == NULL) 193 return NULL; 194 } 195 ret->mangled = NULL; 196 return (struct hash_entry *) ret; 197} 198 199/* Look up an entry in the demangled name hash table. */ 200 201static struct demangled_hash_entry * 202demangled_hash_lookup (string, create) 203 const char *string; |
212 boolean create; | 204 int create; |
213{ 214 return ((struct demangled_hash_entry *) | 205{ 206 return ((struct demangled_hash_entry *) |
215 hash_lookup (&demangled_table, (hash_table_key) string, 216 create, &string_copy)); | 207 hash_lookup (&demangled_table, (const hash_table_key) string, 208 create, string_copy)); |
217} 218 219/* Stack code. */ 220 221struct symbol_stack_entry 222{ 223 symbol *value; 224 struct symbol_stack_entry *next; --- 66 unchanged lines hidden (view full) --- 291 292/* Other machinery. */ 293 294/* Initialize the tlink machinery. Called from do_tlink. */ 295 296static void 297tlink_init () 298{ | 209} 210 211/* Stack code. */ 212 213struct symbol_stack_entry 214{ 215 symbol *value; 216 struct symbol_stack_entry *next; --- 66 unchanged lines hidden (view full) --- 283 284/* Other machinery. */ 285 286/* Initialize the tlink machinery. Called from do_tlink. */ 287 288static void 289tlink_init () 290{ |
299 char *p; | 291 const char *p; |
300 | 292 |
301 hash_table_init (&symbol_table, symbol_hash_newfunc, &string_hash, 302 &string_compare); 303 hash_table_init (&file_table, file_hash_newfunc, &string_hash, 304 &string_compare); | 293 hash_table_init (&symbol_table, symbol_hash_newfunc, string_hash, 294 string_compare); 295 hash_table_init (&file_table, file_hash_newfunc, string_hash, 296 string_compare); |
305 hash_table_init (&demangled_table, demangled_hash_newfunc, | 297 hash_table_init (&demangled_table, demangled_hash_newfunc, |
306 &string_hash, &string_compare); | 298 string_hash, string_compare); |
307 obstack_begin (&symbol_stack_obstack, 0); 308 obstack_begin (&file_stack_obstack, 0); 309 310 p = getenv ("TLINK_VERBOSE"); 311 if (p) 312 tlink_verbose = atoi (p); 313 else 314 { 315 tlink_verbose = 1; 316 if (vflag) 317 tlink_verbose = 2; 318 if (debug) 319 tlink_verbose = 3; 320 } 321} 322 323static int 324tlink_execute (prog, argv, redir) | 299 obstack_begin (&symbol_stack_obstack, 0); 300 obstack_begin (&file_stack_obstack, 0); 301 302 p = getenv ("TLINK_VERBOSE"); 303 if (p) 304 tlink_verbose = atoi (p); 305 else 306 { 307 tlink_verbose = 1; 308 if (vflag) 309 tlink_verbose = 2; 310 if (debug) 311 tlink_verbose = 3; 312 } 313} 314 315static int 316tlink_execute (prog, argv, redir) |
325 char *prog; | 317 const char *prog; |
326 char **argv; | 318 char **argv; |
327 char *redir; | 319 const char *redir; |
328{ 329 collect_execute (prog, argv, redir); 330 return collect_wait (prog); 331} 332 333static char * 334frob_extension (s, ext) | 320{ 321 collect_execute (prog, argv, redir); 322 return collect_wait (prog); 323} 324 325static char * 326frob_extension (s, ext) |
335 char *s; | 327 const char *s; |
336 const char *ext; 337{ | 328 const char *ext; 329{ |
338 char *p = rindex (s, '/'); | 330 const char *p = strrchr (s, '/'); |
339 if (! p) 340 p = s; | 331 if (! p) 332 p = s; |
341 p = rindex (p, '.'); | 333 p = strrchr (p, '.'); |
342 if (! p) 343 p = s + strlen (s); 344 345 obstack_grow (&temporary_obstack, s, p - s); 346 return obstack_copy0 (&temporary_obstack, ext, strlen (ext)); 347} 348 349static char * --- 36 unchanged lines hidden (view full) --- 386freadsym (stream, f, chosen) 387 FILE *stream; 388 file *f; 389 int chosen; 390{ 391 symbol *sym; 392 393 { | 334 if (! p) 335 p = s + strlen (s); 336 337 obstack_grow (&temporary_obstack, s, p - s); 338 return obstack_copy0 (&temporary_obstack, ext, strlen (ext)); 339} 340 341static char * --- 36 unchanged lines hidden (view full) --- 378freadsym (stream, f, chosen) 379 FILE *stream; 380 file *f; 381 int chosen; 382{ 383 symbol *sym; 384 385 { |
394 char *name = tfgets (stream); | 386 const char *name = tfgets (stream); |
395 sym = symbol_hash_lookup (name, true); 396 } 397 398 if (sym->file == NULL) 399 { 400 /* We didn't have this symbol already, so we choose this file. */ 401 402 symbol_push (sym); --- 25 unchanged lines hidden (view full) --- 428static void 429read_repo_file (f) 430 file *f; 431{ 432 char c; 433 FILE *stream = fopen ((char*) f->root.key, "r"); 434 435 if (tlink_verbose >= 2) | 387 sym = symbol_hash_lookup (name, true); 388 } 389 390 if (sym->file == NULL) 391 { 392 /* We didn't have this symbol already, so we choose this file. */ 393 394 symbol_push (sym); --- 25 unchanged lines hidden (view full) --- 420static void 421read_repo_file (f) 422 file *f; 423{ 424 char c; 425 FILE *stream = fopen ((char*) f->root.key, "r"); 426 427 if (tlink_verbose >= 2) |
436 fprintf (stderr, "collect: reading %s\n", | 428 fprintf (stderr, _("collect: reading %s\n"), |
437 (char*) f->root.key); 438 439 while (fscanf (stream, "%c ", &c) == 1) 440 { 441 switch (c) 442 { 443 case 'A': 444 f->args = pfgets (stream); --- 53 unchanged lines hidden (view full) --- 498 499 XXX Should this use collect_execute instead of system? */ 500 501static int 502recompile_files () 503{ 504 file *f; 505 | 429 (char*) f->root.key); 430 431 while (fscanf (stream, "%c ", &c) == 1) 432 { 433 switch (c) 434 { 435 case 'A': 436 f->args = pfgets (stream); --- 53 unchanged lines hidden (view full) --- 490 491 XXX Should this use collect_execute instead of system? */ 492 493static int 494recompile_files () 495{ 496 file *f; 497 |
498 putenv (xstrdup ("COMPILER_PATH")); 499 putenv (xstrdup ("LIBRARY_PATH")); 500 |
|
506 while ((f = file_pop ()) != NULL) 507 { 508 char *line, *command; 509 FILE *stream = fopen ((char*) f->root.key, "r"); | 501 while ((f = file_pop ()) != NULL) 502 { 503 char *line, *command; 504 FILE *stream = fopen ((char*) f->root.key, "r"); |
510 char *outname = frob_extension ((char*) f->root.key, ".rnw"); | 505 const char *const outname = frob_extension ((char*) f->root.key, ".rnw"); |
511 FILE *output = fopen (outname, "w"); 512 513 while ((line = tfgets (stream)) != NULL) 514 { 515 switch (line[0]) 516 { 517 case 'C': 518 case 'O': --- 10 unchanged lines hidden (view full) --- 529 obstack_grow (&temporary_obstack, "; ", 2); 530 obstack_grow (&temporary_obstack, c_file_name, strlen (c_file_name)); 531 obstack_1grow (&temporary_obstack, ' '); 532 obstack_grow (&temporary_obstack, f->args, strlen (f->args)); 533 obstack_1grow (&temporary_obstack, ' '); 534 command = obstack_copy0 (&temporary_obstack, f->main, strlen (f->main)); 535 536 if (tlink_verbose) | 506 FILE *output = fopen (outname, "w"); 507 508 while ((line = tfgets (stream)) != NULL) 509 { 510 switch (line[0]) 511 { 512 case 'C': 513 case 'O': --- 10 unchanged lines hidden (view full) --- 524 obstack_grow (&temporary_obstack, "; ", 2); 525 obstack_grow (&temporary_obstack, c_file_name, strlen (c_file_name)); 526 obstack_1grow (&temporary_obstack, ' '); 527 obstack_grow (&temporary_obstack, f->args, strlen (f->args)); 528 obstack_1grow (&temporary_obstack, ' '); 529 command = obstack_copy0 (&temporary_obstack, f->main, strlen (f->main)); 530 531 if (tlink_verbose) |
537 fprintf (stderr, "collect: recompiling %s\n", f->main); | 532 fprintf (stderr, _("collect: recompiling %s\n"), f->main); |
538 if (tlink_verbose >= 3) 539 fprintf (stderr, "%s\n", command); 540 541 if (system (command) != 0) 542 return 0; 543 544 read_repo_file (f); 545 --- 8 unchanged lines hidden (view full) --- 554static int 555read_repo_files (object_lst) 556 char **object_lst; 557{ 558 char **object = object_lst; 559 560 for (; *object; object++) 561 { | 533 if (tlink_verbose >= 3) 534 fprintf (stderr, "%s\n", command); 535 536 if (system (command) != 0) 537 return 0; 538 539 read_repo_file (f); 540 --- 8 unchanged lines hidden (view full) --- 549static int 550read_repo_files (object_lst) 551 char **object_lst; 552{ 553 char **object = object_lst; 554 555 for (; *object; object++) 556 { |
562 char *p = frob_extension (*object, ".rpo"); | 557 const char *p; |
563 file *f; 564 | 558 file *f; 559 |
560 /* Don't bother trying for ld flags. */ 561 if (*object[0] == '-') 562 continue; 563 564 p = frob_extension (*object, ".rpo"); 565 |
|
565 if (! file_exists (p)) 566 continue; 567 568 f = file_hash_lookup (p); 569 570 read_repo_file (f); 571 } 572 --- 8 unchanged lines hidden (view full) --- 581static void 582demangle_new_symbols () 583{ 584 symbol *sym; 585 586 while ((sym = symbol_pop ()) != NULL) 587 { 588 demangled *dem; | 566 if (! file_exists (p)) 567 continue; 568 569 f = file_hash_lookup (p); 570 571 read_repo_file (f); 572 } 573 --- 8 unchanged lines hidden (view full) --- 582static void 583demangle_new_symbols () 584{ 585 symbol *sym; 586 587 while ((sym = symbol_pop ()) != NULL) 588 { 589 demangled *dem; |
589 char *p = cplus_demangle ((char*) sym->root.key, | 590 const char *p = cplus_demangle ((char*) sym->root.key, |
590 DMGL_PARAMS | DMGL_ANSI); 591 592 if (! p) 593 continue; 594 595 dem = demangled_hash_lookup (p, true); 596 dem->mangled = (char*) sym->root.key; 597 } --- 29 unchanged lines hidden (view full) --- 627 ++p; 628 if (*p == '_' && prepends_underscore) 629 ++p; 630 631 end = ! *q; 632 *q = 0; 633 sym = symbol_hash_lookup (p, false); 634 | 591 DMGL_PARAMS | DMGL_ANSI); 592 593 if (! p) 594 continue; 595 596 dem = demangled_hash_lookup (p, true); 597 dem->mangled = (char*) sym->root.key; 598 } --- 29 unchanged lines hidden (view full) --- 628 ++p; 629 if (*p == '_' && prepends_underscore) 630 ++p; 631 632 end = ! *q; 633 *q = 0; 634 sym = symbol_hash_lookup (p, false); 635 |
636 /* Some SVR4 linkers produce messages like 637 ld: 0711-317 ERROR: Undefined symbol: .g__t3foo1Zi 638 */ 639 if (! sym && ! end && strstr (q+1, "Undefined symbol: ")) 640 { 641 char *p = strrchr (q+1, ' '); 642 p++; 643 if (*p == '.') 644 p++; 645 if (*p == '_' && prepends_underscore) 646 p++; 647 sym = symbol_hash_lookup (p, false); 648 } 649 |
|
635 if (! sym && ! end) 636 /* Try a mangled name in quotes. */ 637 { | 650 if (! sym && ! end) 651 /* Try a mangled name in quotes. */ 652 { |
638 char *oldq = q+1; | 653 const char *oldq = q+1; |
639 demangled *dem = 0; 640 q = 0; 641 642 /* First try `GNU style'. */ | 654 demangled *dem = 0; 655 q = 0; 656 657 /* First try `GNU style'. */ |
643 p = index (oldq, '`'); | 658 p = strchr (oldq, '`'); |
644 if (p) | 659 if (p) |
645 p++, q = index (p, '\''); | 660 p++, q = strchr (p, '\''); |
646 /* Then try "double quotes". */ | 661 /* Then try "double quotes". */ |
647 else if (p = index (oldq, '"'), p) 648 p++, q = index (p, '"'); | 662 else if (p = strchr (oldq, '"'), p) 663 p++, q = strchr (p, '"'); |
649 | 664 |
650 if (q) | 665 /* Don't let the strstr's below see the demangled name; we 666 might get spurious matches. */ 667 if (p) 668 p[-1] = '\0'; 669 670 /* We need to check for certain error keywords here, or we would 671 mistakenly use GNU ld's "In function `foo':" message. */ 672 if (q && (strstr (oldq, "ndefined") 673 || strstr (oldq, "nresolved") 674 || strstr (oldq, "nsatisfied") 675 || strstr (oldq, "ultiple"))) |
651 { 652 *q = 0; 653 dem = demangled_hash_lookup (p, false); 654 if (dem) 655 sym = symbol_hash_lookup (dem->mangled, false); 656 else 657 { 658 if (*p == '_' && prepends_underscore) --- 6 unchanged lines hidden (view full) --- 665 if (sym && sym->tweaked) 666 { 667 fclose (stream); 668 return 0; 669 } 670 if (sym && !sym->tweaking) 671 { 672 if (tlink_verbose >= 2) | 676 { 677 *q = 0; 678 dem = demangled_hash_lookup (p, false); 679 if (dem) 680 sym = symbol_hash_lookup (dem->mangled, false); 681 else 682 { 683 if (*p == '_' && prepends_underscore) --- 6 unchanged lines hidden (view full) --- 690 if (sym && sym->tweaked) 691 { 692 fclose (stream); 693 return 0; 694 } 695 if (sym && !sym->tweaking) 696 { 697 if (tlink_verbose >= 2) |
673 fprintf (stderr, "collect: tweaking %s in %s\n", | 698 fprintf (stderr, _("collect: tweaking %s in %s\n"), |
674 (char*) sym->root.key, (char*) sym->file->root.key); 675 sym->tweaking = 1; 676 file_push (sym->file); 677 } 678 679 obstack_free (&temporary_obstack, temporary_firstobj); 680 } 681 --- 7 unchanged lines hidden (view full) --- 689 mentioned in the linker error messages. 690 691 LD_ARGV is an array of arguments for the linker. 692 OBJECT_LST is an array of object files that we may be able to recompile 693 to provide missing definitions. Currently ignored. */ 694 695void 696do_tlink (ld_argv, object_lst) | 699 (char*) sym->root.key, (char*) sym->file->root.key); 700 sym->tweaking = 1; 701 file_push (sym->file); 702 } 703 704 obstack_free (&temporary_obstack, temporary_firstobj); 705 } 706 --- 7 unchanged lines hidden (view full) --- 714 mentioned in the linker error messages. 715 716 LD_ARGV is an array of arguments for the linker. 717 OBJECT_LST is an array of object files that we may be able to recompile 718 to provide missing definitions. Currently ignored. */ 719 720void 721do_tlink (ld_argv, object_lst) |
697 char **ld_argv, **object_lst; | 722 char **ld_argv, **object_lst ATTRIBUTE_UNUSED; |
698{ 699 int exit = tlink_execute ("ld", ld_argv, ldout); 700 701 tlink_init (); 702 703 if (exit) 704 { 705 int i = 0; --- 6 unchanged lines hidden (view full) --- 712 if (tlink_verbose >= 3) 713 dump_file (ldout); 714 demangle_new_symbols (); 715 if (! scan_linker_output (ldout)) 716 break; 717 if (! recompile_files ()) 718 break; 719 if (tlink_verbose) | 723{ 724 int exit = tlink_execute ("ld", ld_argv, ldout); 725 726 tlink_init (); 727 728 if (exit) 729 { 730 int i = 0; --- 6 unchanged lines hidden (view full) --- 737 if (tlink_verbose >= 3) 738 dump_file (ldout); 739 demangle_new_symbols (); 740 if (! scan_linker_output (ldout)) 741 break; 742 if (! recompile_files ()) 743 break; 744 if (tlink_verbose) |
720 fprintf (stderr, "collect: relinking\n"); | 745 fprintf (stderr, _("collect: relinking\n")); |
721 exit = tlink_execute ("ld", ld_argv, ldout); 722 } 723 } 724 725 dump_file (ldout); 726 unlink (ldout); 727 if (exit) 728 { 729 error ("ld returned %d exit status", exit); 730 collect_exit (exit); 731 } 732} | 746 exit = tlink_execute ("ld", ld_argv, ldout); 747 } 748 } 749 750 dump_file (ldout); 751 unlink (ldout); 752 if (exit) 753 { 754 error ("ld returned %d exit status", exit); 755 collect_exit (exit); 756 } 757} |