Rev 5199 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5199 | Rev 6324 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | /* ldcref.c -- output a cross reference table |
1 | /* ldcref.c -- output a cross reference table |
2 | Copyright 1996-2013 Free Software Foundation, Inc. |
2 | Copyright (C) 1996-2015 Free Software Foundation, Inc. |
3 | Written by Ian Lance Taylor |
3 | Written by Ian Lance Taylor |
Line 4... | Line 4... | ||
4 | 4 | ||
Line 5... | Line 5... | ||
5 | This file is part of the GNU Binutils. |
5 | This file is part of the GNU Binutils. |
Line 38... | Line 38... | ||
38 | #include "ldlang.h" |
38 | #include "ldlang.h" |
Line 39... | Line 39... | ||
39 | 39 | ||
40 | /* We keep an instance of this structure for each reference to a |
40 | /* We keep an instance of this structure for each reference to a |
Line 41... | Line 41... | ||
41 | symbol from a given object. */ |
41 | symbol from a given object. */ |
- | 42 | ||
42 | 43 | struct cref_ref |
|
43 | struct cref_ref { |
44 | { |
44 | /* The next reference. */ |
45 | /* The next reference. */ |
45 | struct cref_ref *next; |
46 | struct cref_ref *next; |
46 | /* The object. */ |
47 | /* The object. */ |
Line 53... | Line 54... | ||
53 | unsigned int undef : 1; |
54 | unsigned int undef : 1; |
54 | }; |
55 | }; |
Line 55... | Line 56... | ||
55 | 56 | ||
Line 56... | Line 57... | ||
56 | /* We keep a hash table of symbols. Each entry looks like this. */ |
57 | /* We keep a hash table of symbols. Each entry looks like this. */ |
- | 58 | ||
57 | 59 | struct cref_hash_entry |
|
58 | struct cref_hash_entry { |
60 | { |
59 | struct bfd_hash_entry root; |
61 | struct bfd_hash_entry root; |
60 | /* The demangled name. */ |
62 | /* The demangled name. */ |
61 | const char *demangled; |
63 | const char *demangled; |
62 | /* References to and definitions of this symbol. */ |
64 | /* References to and definitions of this symbol. */ |
Line 63... | Line 65... | ||
63 | struct cref_ref *refs; |
65 | struct cref_ref *refs; |
Line 64... | Line 66... | ||
64 | }; |
66 | }; |
- | 67 | ||
65 | 68 | /* This is what the hash table looks like. */ |
|
66 | /* This is what the hash table looks like. */ |
69 | |
Line 67... | Line 70... | ||
67 | 70 | struct cref_hash_table |
|
Line 346... | Line 349... | ||
346 | const struct cref_hash_entry * const *p1 = |
349 | const struct cref_hash_entry * const *p1 = |
347 | (const struct cref_hash_entry * const *) a1; |
350 | (const struct cref_hash_entry * const *) a1; |
348 | const struct cref_hash_entry * const *p2 = |
351 | const struct cref_hash_entry * const *p2 = |
349 | (const struct cref_hash_entry * const *) a2; |
352 | (const struct cref_hash_entry * const *) a2; |
Line -... | Line 353... | ||
- | 353 | ||
350 | 354 | if (demangling) |
|
- | 355 | return strcmp ((*p1)->demangled, (*p2)->demangled); |
|
- | 356 | else |
|
351 | return strcmp ((*p1)->demangled, (*p2)->demangled); |
357 | return strcmp ((*p1)->root.string, (*p2)->root.string); |
Line 352... | Line 358... | ||
352 | } |
358 | } |
Line 353... | Line 359... | ||
353 | 359 | ||
Line 424... | Line 430... | ||
424 | return; |
430 | return; |
425 | } |
431 | } |
426 | } |
432 | } |
427 | } |
433 | } |
Line -... | Line 434... | ||
- | 434 | ||
- | 435 | if (demangling) |
|
428 | 436 | { |
|
429 | fprintf (fp, "%s ", h->demangled); |
437 | fprintf (fp, "%s ", h->demangled); |
- | 438 | len = strlen (h->demangled) + 1; |
|
- | 439 | } |
|
- | 440 | else |
|
- | 441 | { |
|
- | 442 | fprintf (fp, "%s ", h->root.string); |
|
- | 443 | len = strlen (h->root.string) + 1; |
|
Line 430... | Line 444... | ||
430 | len = strlen (h->demangled) + 1; |
444 | } |
431 | 445 | ||
432 | for (r = h->refs; r != NULL; r = r->next) |
446 | for (r = h->refs; r != NULL; r = r->next) |
433 | { |
447 | { |