summaryrefslogtreecommitdiff
path: root/bfd/linker.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2011-04-24 10:02:10 +0000
committerAlan Modra <amodra@bigpond.net.au>2011-04-24 10:02:10 +0000
commit71b09b5e7cfe43eac367b5cf1218ae1f988c18c3 (patch)
treedd889e705be917630f4c1a1d72fd98f854de2ab2 /bfd/linker.c
parent28544dfcd23ab3ea3159f421978c0c5155c1136e (diff)
downloadbinutils-redhat-71b09b5e7cfe43eac367b5cf1218ae1f988c18c3.tar.gz
PR ld/12365
PR ld/12696 include/ * bfdlink.h (ENUM_BITFIELD): Define. (struct bfd_link_hash_entry): Make "type" a bitfield. Add "non_ir_ref". (struct bfd_link_callbacks <notice>): Pass bfd_link_hash_entry pointer rather than "name". bfd/ * coff-aux.c (coff_m68k_aux_link_add_one_symbol): Update "notice" call. * linker.c (_bfd_link_hash_newfunc): Clear bitfields. (_bfd_generic_link_add_one_symbol): Update "notice" call. * elflink.c (_bfd_elf_merge_symbol): Don't skip weak redefs when it is a redef of an IR symbol in a real BFD. ld/ * ldmain.c (notice): Delete "name" param, add "h". * plugin.c (plugin_notice): Likewise. Set non_ir_ref. Handle redefinitions of IR symbols in real BFDs. (plugin_multiple_definition, plugin_multiple_common): Delete. (non_ironly_hash, init_non_ironly_hash): Delete. (is_visible_from_outside): Traverse entry_symbol chain. (get_symbols): Use non_ir_ref flag rather than hash lookup.
Diffstat (limited to 'bfd/linker.c')
-rw-r--r--bfd/linker.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/bfd/linker.c b/bfd/linker.c
index 9f2bac3c44..d7ac067824 100644
--- a/bfd/linker.c
+++ b/bfd/linker.c
@@ -465,10 +465,8 @@ _bfd_link_hash_newfunc (struct bfd_hash_entry *entry,
struct bfd_link_hash_entry *h = (struct bfd_link_hash_entry *) entry;
/* Initialize the local fields. */
- h->type = bfd_link_hash_new;
- memset (&h->u.undef.next, 0,
- (sizeof (struct bfd_link_hash_entry)
- - offsetof (struct bfd_link_hash_entry, u.undef.next)));
+ memset ((char *) &h->root + sizeof (h->root), 0,
+ sizeof (*h) - sizeof (h->root));
}
return entry;
@@ -1609,8 +1607,7 @@ _bfd_generic_link_add_one_symbol (struct bfd_link_info *info,
|| (info->notice_hash != NULL
&& bfd_hash_lookup (info->notice_hash, name, FALSE, FALSE) != NULL))
{
- if (! (*info->callbacks->notice) (info, h->root.string, abfd, section,
- value))
+ if (! (*info->callbacks->notice) (info, h, abfd, section, value))
return FALSE;
}