summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Modra <modra@gmail.com>2011-04-27 07:17:42 +0000
committerAlan Modra <modra@gmail.com>2011-04-27 07:17:42 +0000
commit7f38e8b8930c1113e1355935a894f0a56d40f8d3 (patch)
tree8d2470a863f2cba9fe7df4a0e518aee7025cd896
parentb183263d306d28818b5df8c43cd87fc27b3de5b8 (diff)
downloadcygnal-7f38e8b8930c1113e1355935a894f0a56d40f8d3.tar.gz
cygnal-7f38e8b8930c1113e1355935a894f0a56d40f8d3.tar.bz2
cygnal-7f38e8b8930c1113e1355935a894f0a56d40f8d3.zip
PR ld/12696
PR ld/12672 PR ld/12507 PR ld/12365 PR 10549 Backport fixes for these PRs.
-rw-r--r--include/ChangeLog23
-rw-r--r--include/bfdlink.h37
2 files changed, 38 insertions, 22 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index aa8e29e4a..684e7b5d9 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,20 @@
+2011-04-27 Alan Modra <amodra@gmail.com>
+
+ Backport from mainline.
+ 2011-04-24 Alan Modra <amodra@gmail.com>
+ PR ld/12365
+ PR ld/12696
+ * 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".
+
+ 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.
+
2010-11-25 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* opcode/s390.h (enum s390_opcode_cpu_val): Add S390_OPCODE_MAXCPU.
@@ -6,19 +23,19 @@
* 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/.
* 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).
* bfdlink.h (struct_bfd_link_callbacks): Document new argument
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.
-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).
* plugin-api.h (LDPT_GNU_LD_VERSION): New ld_plugin_tag enum member.
diff --git a/include/bfdlink.h b/include/bfdlink.h
index 0d6e9f8ae..66f76455b 100644
--- a/include/bfdlink.h
+++ b/include/bfdlink.h
@@ -23,6 +23,12 @@
#ifndef BFDLINK_H
#define BFDLINK_H
+#if (__GNUC__ * 1000 + __GNUC_MINOR__ > 2000)
+#define ENUM_BITFIELD(TYPE) __extension__ enum TYPE
+#else
+#define ENUM_BITFIELD(TYPE) unsigned int
+#endif
+
/* Which symbols to strip during a link. */
enum bfd_link_strip
{
@@ -90,7 +96,9 @@ struct bfd_link_hash_entry
struct bfd_hash_entry root;
/* Type of this entry. */
- enum bfd_link_hash_type type;
+ ENUM_BITFIELD (bfd_link_hash_type) type : 8;
+
+ unsigned int non_ir_ref : 1;
/* A union of information depending upon the type. */
union
@@ -487,29 +495,20 @@ struct bfd_link_callbacks
bfd_boolean (*add_archive_element)
(struct bfd_link_info *, bfd *abfd, const char *name, bfd **subsbfd);
/* A function which is called when a symbol is found with multiple
- definitions. NAME is the symbol which is defined multiple times.
- OBFD is the old BFD, OSEC is the old section, OVAL is the old
- value, NBFD is the new BFD, NSEC is the new section, and NVAL is
- the new value. OBFD may be NULL. OSEC and NSEC may be
- bfd_com_section or bfd_ind_section. */
+ definitions. H is the symbol which is defined multiple times.
+ NBFD is the new BFD, NSEC is the new section, and NVAL is the new
+ value. NSEC may be bfd_com_section or bfd_ind_section. */
bfd_boolean (*multiple_definition)
- (struct bfd_link_info *, const char *name,
- bfd *obfd, asection *osec, bfd_vma oval,
+ (struct bfd_link_info *, struct bfd_link_hash_entry *h,
bfd *nbfd, asection *nsec, bfd_vma nval);
/* A function which is called when a common symbol is defined
- multiple times. NAME 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.
+ multiple times. H is the symbol appearing multiple times.
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
bfd_link_hash_indirect. If NTYPE is bfd_link_hash_common, NSIZE
is the size of the new symbol. */
bfd_boolean (*multiple_common)
- (struct bfd_link_info *, const char *name,
- bfd *obfd, enum bfd_link_hash_type otype, bfd_vma osize,
+ (struct bfd_link_info *, struct bfd_link_hash_entry *h,
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
the link hash table entry for the set itself (e.g.,
@@ -578,11 +577,11 @@ struct bfd_link_callbacks
(struct bfd_link_info *, const char *name,
bfd *abfd, asection *section, bfd_vma address);
/* A function which is called when a symbol in notice_hash is
- defined or referenced. NAME is the symbol. ABFD, SECTION and
- ADDRESS are the value of the symbol. If SECTION is
+ defined or referenced. H is the symbol. ABFD, SECTION and
+ ADDRESS are the (new) value of the symbol. If SECTION is
bfd_und_section, this is a reference. */
bfd_boolean (*notice)
- (struct bfd_link_info *, const char *name,
+ (struct bfd_link_info *, struct bfd_link_hash_entry *h,
bfd *abfd, asection *section, bfd_vma address);
/* Error or warning link info message. */
void (*einfo)