diff options
author | Andrew Stubbs <andrew.stubbs@st.com> | 2009-01-19 11:50:31 +0000 |
---|---|---|
committer | Andrew Stubbs <andrew.stubbs@st.com> | 2009-01-19 11:50:31 +0000 |
commit | 6ff38c5467c4350ee202215949c0fe0d637d433a (patch) | |
tree | 03d299c77bd8654090f6e77d422fb286f1a69421 /bfd/elf-attrs.c | |
parent | 1bff235d1b57572d6837f558001b35cf121747c4 (diff) | |
download | binutils-redhat-6ff38c5467c4350ee202215949c0fe0d637d433a.tar.gz |
2009-01-19 Andrew Stubbs <ams@codesourcery.com>
bfd/
* elf-attrs.c (is_default_attr): Support defaultless attributes.
(bfd_elf_add_obj_attr_int): Get type from _bfd_elf_obj_attrs_arg_type.
(bfd_elf_add_obj_attr_string): Likewise.
(bfd_elf_add_obj_attr_int_string): Likewise.
(_bfd_elf_parse_attributes): Allow for unknown flag bits in type.
* elf-bfd.h (struct obj_attribute): Document new flag bit.
* elf32-arm.c (elf32_arm_obj_attrs_arg_type): Specify that
Tag_nodefaults has no default value.
(elf32_arm_merge_eabi_attributes): Modify the Tag_nodefaults
comment to reflect the new state.
gas/
* read.c (s_vendor_attribute): Allow for unknown flag bits in type.
Diffstat (limited to 'bfd/elf-attrs.c')
-rw-r--r-- | bfd/elf-attrs.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/bfd/elf-attrs.c b/bfd/elf-attrs.c index 4019535a64..dc2605669d 100644 --- a/bfd/elf-attrs.c +++ b/bfd/elf-attrs.c @@ -47,6 +47,8 @@ is_default_attr (obj_attribute *attr) return FALSE; if ((attr->type & 2) && attr->s && *attr->s) return FALSE; + if (attr->type & 4) + return FALSE; return TRUE; } @@ -290,7 +292,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 = 1; + attr->type = _bfd_elf_obj_attrs_arg_type (abfd, vendor, tag); attr->i = i; } @@ -313,7 +315,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 = 2; + attr->type = _bfd_elf_obj_attrs_arg_type (abfd, vendor, tag); attr->s = _bfd_elf_attr_strdup (abfd, s); } @@ -325,7 +327,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 = 3; + attr->type = _bfd_elf_obj_attrs_arg_type (abfd, vendor, tag); attr->i = i; attr->s = _bfd_elf_attr_strdup (abfd, s); } @@ -487,7 +489,7 @@ _bfd_elf_parse_attributes (bfd *abfd, Elf_Internal_Shdr * hdr) tag = read_unsigned_leb128 (abfd, p, &n); p += n; type = _bfd_elf_obj_attrs_arg_type (abfd, vendor, tag); - switch (type) + switch (type & 3) { case 3: val = read_unsigned_leb128 (abfd, p, &n); |