summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Hsieh <andrewhsieh@google.com>2012-11-01 20:53:41 -0700
committerAndrew Hsieh <andrewhsieh@google.com>2012-11-01 20:53:41 -0700
commit674f5ed7b53b43d99319e3dd9c7261c59b47af97 (patch)
tree0ce5f7ba2df5a38c0ad715c5052ea048ba95ce95
parent6d5ce99288a663253fd2cde30516257f754cc776 (diff)
downloadtoolchain_binutils-674f5ed7b53b43d99319e3dd9c7261c59b47af97.zip
toolchain_binutils-674f5ed7b53b43d99319e3dd9c7261c59b47af97.tar.gz
toolchain_binutils-674f5ed7b53b43d99319e3dd9c7261c59b47af97.tar.bz2
[2.22.90] Fix newer binutils not to assert on non-existence tag_FP_arch
See 1342ca94f07e5164f14acb74b2c3903ba0c4009a Change-Id: Iff0fa77f8c55bbf7902d93e95bad873447f4e8cd
-rw-r--r--binutils-2.22/bfd/elf-attrs.c6
-rw-r--r--binutils-2.22/bfd/elf-bfd.h5
-rw-r--r--binutils-2.22/bfd/elf32-arm.c4
3 files changed, 10 insertions, 5 deletions
diff --git a/binutils-2.22/bfd/elf-attrs.c b/binutils-2.22/bfd/elf-attrs.c
index 4237af5..742608d 100644
--- a/binutils-2.22/bfd/elf-attrs.c
+++ b/binutils-2.22/bfd/elf-attrs.c
@@ -297,7 +297,7 @@ bfd_elf_add_obj_attr_int (bfd *abfd, int vendor, int tag, unsigned int i)
obj_attribute *attr;
attr = elf_new_obj_attr (abfd, vendor, tag);
- attr->type = _bfd_elf_obj_attrs_arg_type (abfd, vendor, tag);
+ attr->type = _bfd_elf_obj_attrs_arg_type (abfd, vendor, tag) | ATTR_TYPE_FLAG_EXIST;
attr->i = i;
}
@@ -320,7 +320,7 @@ bfd_elf_add_obj_attr_string (bfd *abfd, int vendor, int tag, const char *s)
obj_attribute *attr;
attr = elf_new_obj_attr (abfd, vendor, tag);
- attr->type = _bfd_elf_obj_attrs_arg_type (abfd, vendor, tag);
+ attr->type = _bfd_elf_obj_attrs_arg_type (abfd, vendor, tag) | ATTR_TYPE_FLAG_EXIST;
attr->s = _bfd_elf_attr_strdup (abfd, s);
}
@@ -332,7 +332,7 @@ bfd_elf_add_obj_attr_int_string (bfd *abfd, int vendor, int tag,
obj_attribute *attr;
attr = elf_new_obj_attr (abfd, vendor, tag);
- attr->type = _bfd_elf_obj_attrs_arg_type (abfd, vendor, tag);
+ attr->type = _bfd_elf_obj_attrs_arg_type (abfd, vendor, tag) | ATTR_TYPE_FLAG_EXIST;
attr->i = i;
attr->s = _bfd_elf_attr_strdup (abfd, s);
}
diff --git a/binutils-2.22/bfd/elf-bfd.h b/binutils-2.22/bfd/elf-bfd.h
index ff0e615..fdd5cf3 100644
--- a/binutils-2.22/bfd/elf-bfd.h
+++ b/binutils-2.22/bfd/elf-bfd.h
@@ -1451,17 +1451,20 @@ struct bfd_elf_section_data
/* The value of an object attribute. The type indicates whether the attribute
holds and integer, a string, or both. It can also indicate that there can
- be no default (i.e. all values must be written to file, even zero). */
+ be no default (i.e. all values must be written to file, even zero), and whether
+ it exists in bfd to begin with. */
typedef struct obj_attribute
{
#define ATTR_TYPE_FLAG_INT_VAL (1 << 0)
#define ATTR_TYPE_FLAG_STR_VAL (1 << 1)
#define ATTR_TYPE_FLAG_NO_DEFAULT (1 << 2)
+#define ATTR_TYPE_FLAG_EXIST (1 << 3)
#define ATTR_TYPE_HAS_INT_VAL(TYPE) ((TYPE) & ATTR_TYPE_FLAG_INT_VAL)
#define ATTR_TYPE_HAS_STR_VAL(TYPE) ((TYPE) & ATTR_TYPE_FLAG_STR_VAL)
#define ATTR_TYPE_HAS_NO_DEFAULT(TYPE) ((TYPE) & ATTR_TYPE_FLAG_NO_DEFAULT)
+#define ATTR_TYPE_EXIST(TYPE) ((TYPE) & ATTR_TYPE_FLAG_EXIST)
int type;
unsigned int i;
diff --git a/binutils-2.22/bfd/elf32-arm.c b/binutils-2.22/bfd/elf32-arm.c
index 4f2d00e..20dfb69 100644
--- a/binutils-2.22/bfd/elf32-arm.c
+++ b/binutils-2.22/bfd/elf32-arm.c
@@ -11731,7 +11731,9 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd)
nothing. */
else if (in_attr[i].i == 0)
{
- BFD_ASSERT (in_attr[Tag_ABI_HardFP_use].i == 0);
+ /* When linking against earlier version of object file, Tag_FP_arch may not
+ even exist, while Tag_ABI_HardFP_use is non-zero. */
+ BFD_ASSERT (!ATTR_TYPE_EXIST(in_attr[i].type) || in_attr[Tag_ABI_HardFP_use].i == 0);
break;
}