PR ld/12365

include/
	* bfdlink.h (struct bfd_link_callbacks): Modify multiple_definition
	and multiple_common parameters to pass in a bfd_link_hash_entry
	pointer rather than name,bfd etc. found in the hash entry.
bfd/
	* elflink.c (_bfd_elf_merge_symbol): Update multiple_common calls.
	* linker.c (_bfd_generic_link_add_one_symbol): Likewise.  Call
	multiple_definition regardless of allow_multiple_definition.
	* simple.c (simple_dummy_multiple_definition): Update.
	* xcofflink.c (xcoff_link_add_symbols): Update multiple_definition
	calls.
ld/
	* ldmain.c (multiple_definition): Take a bfd_link_hash_entry
	pointer arg rather than "name", "obfd", "osec", "oval".  Add code
	removed from linker.c.  Hack around xcofflink.c oddity in
	passing NULL nbfd.
	(multiple_common): Similarly.
	* plugin.c (orig_allow_multiple_defs): Delete.
	(plugin_call_all_symbols_read): Don't twiddle allow_multiple_definition.
	(plugin_multiple_definition): Update.
This commit is contained in:
Alan Modra 2011-04-20 00:11:29 +00:00
parent 11629685f1
commit 46ac7c5a4f
2 changed files with 18 additions and 19 deletions

View File

@ -1,3 +1,10 @@
2011-04-20 Alan Modra <amodra@gmail.com>
PR ld/12365
* bfdlink.h (struct bfd_link_callbacks): Modify multiple_definition
and multiple_common parameters to pass in a bfd_link_hash_entry
pointer rather than name,bfd etc. found in the hash entry.
2011-03-31 Tristan Gingold <gingold@adacore.com> 2011-03-31 Tristan Gingold <gingold@adacore.com>
* dwarf2.h (dwarf_line_number_hp_sfc_ops): New enum. * dwarf2.h (dwarf_line_number_hp_sfc_ops): New enum.
@ -64,19 +71,19 @@
* simple-object.h: New file. * simple-object.h: New file.
2010-10-15 Dave Korn <dave.korn.cygwin@gmail.com> 2010-10-15 Dave Korn <dave.korn.cygwin@gmail.com>
Sync LD plugin patch series (part 1/6) with src/include/. Sync LD plugin patch series (part 1/6) with src/include/.
* plugin-api.h (LDPT_GNU_LD_VERSION): New ld_plugin_tag enum member. * plugin-api.h (LDPT_GNU_LD_VERSION): New ld_plugin_tag enum member.
2010-10-14 Dave Korn <dave.korn.cygwin@gmail.com> 2010-10-14 Dave Korn <dave.korn.cygwin@gmail.com>
Apply LD plugin patch series (part 6/6). Apply LD plugin patch series (part 6/6).
* bfdlink.h (struct_bfd_link_callbacks): Document new argument * bfdlink.h (struct_bfd_link_callbacks): Document new argument
to add_archive_element callback used to return a replacement bfd which to add_archive_element callback used to return a replacement bfd which
is to be added to the hash table in place of the original element. is to be added to the hash table in place of the original element.
2010-10-14 Dave Korn <dave.korn.cygwin@gmail.com> 2010-10-14 Dave Korn <dave.korn.cygwin@gmail.com>
Apply LD plugin patch series (part 1/6). Apply LD plugin patch series (part 1/6).
* plugin-api.h (LDPT_GNU_LD_VERSION): New ld_plugin_tag enum member. * plugin-api.h (LDPT_GNU_LD_VERSION): New ld_plugin_tag enum member.

View File

@ -1,6 +1,7 @@
/* bfdlink.h -- header file for BFD link routines /* bfdlink.h -- header file for BFD link routines
Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Written by Steve Chamberlain and Ian Lance Taylor, Cygnus Support. Written by Steve Chamberlain and Ian Lance Taylor, Cygnus Support.
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -487,29 +488,20 @@ struct bfd_link_callbacks
bfd_boolean (*add_archive_element) bfd_boolean (*add_archive_element)
(struct bfd_link_info *, bfd *abfd, const char *name, bfd **subsbfd); (struct bfd_link_info *, bfd *abfd, const char *name, bfd **subsbfd);
/* A function which is called when a symbol is found with multiple /* A function which is called when a symbol is found with multiple
definitions. NAME is the symbol which is defined multiple times. definitions. H is the symbol which is defined multiple times.
OBFD is the old BFD, OSEC is the old section, OVAL is the old NBFD is the new BFD, NSEC is the new section, and NVAL is the new
value, NBFD is the new BFD, NSEC is the new section, and NVAL is value. NSEC may be bfd_com_section or bfd_ind_section. */
the new value. OBFD may be NULL. OSEC and NSEC may be
bfd_com_section or bfd_ind_section. */
bfd_boolean (*multiple_definition) bfd_boolean (*multiple_definition)
(struct bfd_link_info *, const char *name, (struct bfd_link_info *, struct bfd_link_hash_entry *h,
bfd *obfd, asection *osec, bfd_vma oval,
bfd *nbfd, asection *nsec, bfd_vma nval); bfd *nbfd, asection *nsec, bfd_vma nval);
/* A function which is called when a common symbol is defined /* A function which is called when a common symbol is defined
multiple times. NAME is the symbol appearing multiple times. multiple times. H is the symbol appearing multiple times.
OBFD is the BFD of the existing symbol; it may be NULL if this is
not known. OTYPE is the type of the existing symbol, which may
be bfd_link_hash_defined, bfd_link_hash_defweak,
bfd_link_hash_common, or bfd_link_hash_indirect. If OTYPE is
bfd_link_hash_common, OSIZE is the size of the existing symbol.
NBFD is the BFD of the new symbol. NTYPE is the type of the new NBFD is the BFD of the new symbol. NTYPE is the type of the new
symbol, one of bfd_link_hash_defined, bfd_link_hash_common, or symbol, one of bfd_link_hash_defined, bfd_link_hash_common, or
bfd_link_hash_indirect. If NTYPE is bfd_link_hash_common, NSIZE bfd_link_hash_indirect. If NTYPE is bfd_link_hash_common, NSIZE
is the size of the new symbol. */ is the size of the new symbol. */
bfd_boolean (*multiple_common) bfd_boolean (*multiple_common)
(struct bfd_link_info *, const char *name, (struct bfd_link_info *, struct bfd_link_hash_entry *h,
bfd *obfd, enum bfd_link_hash_type otype, bfd_vma osize,
bfd *nbfd, enum bfd_link_hash_type ntype, bfd_vma nsize); bfd *nbfd, enum bfd_link_hash_type ntype, bfd_vma nsize);
/* A function which is called to add a symbol to a set. ENTRY is /* A function which is called to add a symbol to a set. ENTRY is
the link hash table entry for the set itself (e.g., the link hash table entry for the set itself (e.g.,