/* ldcref.c -- output a cross reference table
- Copyright 1996-2014 Free Software Foundation, Inc.
+ Copyright (C) 1996-2017 Free Software Foundation, Inc.
Written by Ian Lance Taylor <ian@cygnus.com>
This file is part of the GNU Binutils.
static struct bfd_hash_entry **old_table;
static unsigned int old_size;
static unsigned int old_count;
-static void * old_tab;
-static void * alloc_mark;
+static void *old_tab;
+static void *alloc_mark;
static size_t tabsize, entsize, refsize;
static size_t old_symcount;
struct cref_hash_entry *h;
struct cref_ref *r;
- if (! cref_initialized)
+ if (!cref_initialized)
{
if (!bfd_hash_table_init (&cref_table.root, cref_hash_newfunc,
sizeof (struct cref_hash_entry)))
static int
cref_sort_array (const void *a1, const void *a2)
{
- const struct cref_hash_entry * const *p1 =
- (const struct cref_hash_entry * const *) a1;
- const struct cref_hash_entry * const *p2 =
- (const struct cref_hash_entry * const *) a2;
+ const struct cref_hash_entry *const *p1
+ = (const struct cref_hash_entry *const *) a1;
+ const struct cref_hash_entry *const *p2
+ = (const struct cref_hash_entry *const *) a2;
if (demangling)
return strcmp ((*p1)->demangled, (*p2)->demangled);
}
fprintf (fp, _("File\n"));
- if (! cref_initialized)
+ if (!cref_initialized)
{
fprintf (fp, _("No symbols\n"));
return;
hl = bfd_link_hash_lookup (link_info.hash, h->root.string, FALSE,
FALSE, TRUE);
if (hl == NULL)
- einfo ("%P: symbol `%T' missing from main hash table\n",
+ einfo (_("%P: symbol `%T' missing from main hash table\n"),
h->root.string);
else
{
for (r = h->refs; r != NULL; r = r->next)
{
- if (! r->def && ! r->common)
+ if (!r->def && !r->common)
{
while (len < FILECOL)
{
void
check_nocrossrefs (void)
{
- if (! cref_initialized)
+ if (!cref_initialized)
return;
cref_hash_traverse (&cref_table, check_nocrossref, NULL);
symname = sym->name;
for (ncrs = nocrossref_list; ncrs != NULL; ncrs = ncrs->next)
for (ncr = ncrs->list; ncr != NULL; ncr = ncr->next)
- if (strcmp (ncr->name, outsecname) == 0)
- check_refs (symname, FALSE, sym->section, abfd, ncrs);
+ {
+ if (strcmp (ncr->name, outsecname) == 0)
+ check_refs (symname, FALSE, sym->section, abfd, ncrs);
+ /* The NOCROSSREFS_TO command only checks symbols defined in
+ the first section in the list. */
+ if (ncrs->onlyfirst)
+ break;
+ }
}
}
}
for (ncrs = nocrossref_list; ncrs != NULL; ncrs = ncrs->next)
for (ncr = ncrs->list; ncr != NULL; ncr = ncr->next)
- if (strcmp (ncr->name, defsecname) == 0)
- for (ref = h->refs; ref != NULL; ref = ref->next)
- check_refs (hl->root.string, TRUE, hl->u.def.section,
- ref->abfd, ncrs);
+ {
+ if (strcmp (ncr->name, defsecname) == 0)
+ for (ref = h->refs; ref != NULL; ref = ref->next)
+ check_refs (hl->root.string, TRUE, hl->u.def.section,
+ ref->abfd, ncrs);
+ /* The NOCROSSREFS_TO command only checks symbols defined in the first
+ section in the list. */
+ if (ncrs->onlyfirst)
+ break;
+ }
return TRUE;
}
/* The struct is used to pass information from check_refs to
check_reloc_refs through bfd_map_over_sections. */
-struct check_refs_info {
+struct check_refs_info
+{
const char *sym_name;
asection *defsec;
struct lang_nocrossrefs *ncrs;