summaryrefslogtreecommitdiffstats
path: root/binutils-2.22
diff options
context:
space:
mode:
authorAndrew Hsieh <andrewhsieh@google.com>2012-10-23 10:56:03 -0700
committerGerrit Code Review <noreply-gerritcodereview@google.com>2012-10-23 10:56:04 -0700
commit567dd0efbbea8ef969b42bfb4381df3d50717202 (patch)
tree2a0860061e0a6cb7ca2d154f776b8b2d7599ed8b /binutils-2.22
parent097cb925ecdcb4d93ef442e2783b5072d3442bcc (diff)
parent1342ca94f07e5164f14acb74b2c3903ba0c4009a (diff)
downloadtoolchain_binutils-567dd0efbbea8ef969b42bfb4381df3d50717202.zip
toolchain_binutils-567dd0efbbea8ef969b42bfb4381df3d50717202.tar.gz
toolchain_binutils-567dd0efbbea8ef969b42bfb4381df3d50717202.tar.bz2
Merge "Fix newer binutils not to assert on non-existence tag_FP_arch"
Diffstat (limited to 'binutils-2.22')
-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 569e846..314265c 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 d6e2ab2..113b75b 100644
--- a/binutils-2.22/bfd/elf-bfd.h
+++ b/binutils-2.22/bfd/elf-bfd.h
@@ -1440,17 +1440,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 30573b0..b1228d8 100644
--- a/binutils-2.22/bfd/elf32-arm.c
+++ b/binutils-2.22/bfd/elf32-arm.c
@@ -11474,7 +11474,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;
}