}
}
- if (info->notice_hash != (struct bfd_hash_table *) NULL
- && (bfd_hash_lookup (info->notice_hash, name, false, false)
- != (struct bfd_hash_entry *) NULL))
+ if (info->notice_all
+ || (info->notice_hash != (struct bfd_hash_table *) NULL
+ && (bfd_hash_lookup (info->notice_hash, name, false, false)
+ != (struct bfd_hash_entry *) NULL)))
{
- if (! (*info->callbacks->notice) (info, name, abfd, section, value))
+ if (! (*info->callbacks->notice) (info, h->root.string, abfd, section,
+ value))
return false;
}
previously common. */
BFD_ASSERT (h->type == bfd_link_hash_common);
if (! ((*info->callbacks->multiple_common)
- (info, name,
+ (info, h->root.string,
h->u.c.p->section->owner, bfd_link_hash_common, h->u.c.size,
abfd, bfd_link_hash_defined, (bfd_vma) 0)))
return false;
if (! ((*info->callbacks->constructor)
(info,
c == 'I' ? true : false,
- name, abfd, section, value)))
+ h->root.string, abfd, section, value)))
return false;
}
}
two sizes. */
BFD_ASSERT (h->type == bfd_link_hash_common);
if (! ((*info->callbacks->multiple_common)
- (info, name,
+ (info, h->root.string,
h->u.c.p->section->owner, bfd_link_hash_common, h->u.c.size,
abfd, bfd_link_hash_common, value)))
return false;
else
obfd = NULL;
if (! ((*info->callbacks->multiple_common)
- (info, name, obfd, h->type, (bfd_vma) 0,
+ (info, h->root.string, obfd, h->type, (bfd_vma) 0,
abfd, bfd_link_hash_common, value)))
return false;
}
break;
if (! ((*info->callbacks->multiple_definition)
- (info, name, msec->owner, msec, mval, abfd, section,
- value)))
+ (info, h->root.string, msec->owner, msec, mval, abfd,
+ section, value)))
return false;
}
break;
/* Create an indirect symbol from an existing common symbol. */
BFD_ASSERT (h->type == bfd_link_hash_common);
if (! ((*info->callbacks->multiple_common)
- (info, name,
+ (info, h->root.string,
h->u.c.p->section->owner, bfd_link_hash_common, h->u.c.size,
abfd, bfd_link_hash_indirect, (bfd_vma) 0)))
return false;
/* Issue a warning and cycle. */
if (h->u.i.warning != NULL)
{
- if (! (*info->callbacks->warning) (info, h->u.i.warning, name,
- abfd, (asection *) NULL,
+ if (! (*info->callbacks->warning) (info, h->u.i.warning,
+ h->root.string, abfd,
+ (asection *) NULL,
(bfd_vma) 0))
return false;
/* Only issue a warning once. */
case WARN:
/* Issue a warning. */
- if (! (*info->callbacks->warning) (info, string, name,
+ if (! (*info->callbacks->warning) (info, string, h->root.string,
hash_entry_bfd (h),
(asection *) NULL, (bfd_vma) 0))
return false;
ensure this. */
if (h->next != NULL || info->hash->undefs_tail == h)
{
- if (! (*info->callbacks->warning) (info, string, name,
+ if (! (*info->callbacks->warning) (info, string, h->root.string,
hash_entry_bfd (h),
(asection *) NULL,
(bfd_vma) 0))
abfd->symcount = 0;
outsymalloc = 0;
+ /* Mark all sections which will be included in the output file. */
+ for (o = abfd->sections; o != NULL; o = o->next)
+ for (p = o->link_order_head; p != NULL; p = p->next)
+ if (p->type == bfd_indirect_link_order)
+ p->u.indirect.section->linker_mark = true;
+
/* Build the output symbol table. */
for (sub = info->input_bfds; sub != (bfd *) NULL; sub = sub->link_next)
if (! _bfd_generic_link_output_symbols (abfd, sub, info, &outsymalloc))
/* This switch is straight from the old code in
write_file_locals in ldsym.c. */
- if (info->strip == strip_some
- && (bfd_hash_lookup (info->keep_hash, bfd_asymbol_name (sym),
- false, false)
- == (struct bfd_hash_entry *) NULL))
+ if (info->strip == strip_all
+ || (info->strip == strip_some
+ && (bfd_hash_lookup (info->keep_hash, bfd_asymbol_name (sym),
+ false, false)
+ == (struct bfd_hash_entry *) NULL)))
output = false;
else if ((sym->flags & (BSF_GLOBAL | BSF_WEAK)) != 0)
{
else
abort ();
+ /* If this symbol is in a section which is not being included
+ in the output file, then we don't want to output the symbol. */
+ if (sym->section->linker_mark == false)
+ output = false;
+
if (output)
{
if (! generic_add_output_symbol (output_bfd, psymalloc, sym))