diff options
author | Joseph Myers <joseph@codesourcery.com> | 2010-06-15 23:10:10 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2010-06-15 23:10:10 +0000 |
commit | 3de4a297ec739ba0111d80a5b9060d9bffc2d899 (patch) | |
tree | a01c545854d8b5bbe1e6feeb71e2981badde2bd2 /bfd/elf-attrs.c | |
parent | 91ff43fe2d1d9c8594e06385af78ed29a063690f (diff) | |
download | fsf-binutils-gdb-3de4a297ec739ba0111d80a5b9060d9bffc2d899.zip fsf-binutils-gdb-3de4a297ec739ba0111d80a5b9060d9bffc2d899.tar.gz fsf-binutils-gdb-3de4a297ec739ba0111d80a5b9060d9bffc2d899.tar.bz2 |
* elf-bfd.h (LEAST_KNOWN_OBJ_ATTRIBUTE): Define.
(struct elf_backend_data): Update comment on obj_attrs_order.
* elf-attrs.c (vendor_obj_attr_size, vendor_set_obj_attr_contents,
_bfd_elf_copy_obj_attributes): Use LEAST_KNOWN_OBJ_ATTRIBUTE
instead of hardcoded 4.
* elf32-arm.c (elf32_arm_obj_attrs_order): Use
LEAST_KNOWN_OBJ_ATTRIBUTE and LEAST_KNOWN_OBJ_ATTRIBUTE + 1
instead of hardcoded 4 and 5.
(elf32_arm_merge_eabi_attributes): Use LEAST_KNOWN_OBJ_ATTRIBUTE
instead of hardcoded 4.
Diffstat (limited to 'bfd/elf-attrs.c')
-rw-r--r-- | bfd/elf-attrs.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/bfd/elf-attrs.c b/bfd/elf-attrs.c index c514ead..b9d3bf2 100644 --- a/bfd/elf-attrs.c +++ b/bfd/elf-attrs.c @@ -1,5 +1,5 @@ /* ELF attributes support (based on ARM EABI attributes). - Copyright 2005, 2006, 2007, 2009 + Copyright 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -96,7 +96,7 @@ vendor_obj_attr_size (bfd *abfd, int vendor) attr = elf_known_obj_attributes (abfd)[vendor]; size = 0; - for (i = 4; i < NUM_KNOWN_OBJ_ATTRIBUTES; i++) + for (i = LEAST_KNOWN_OBJ_ATTRIBUTE; i < NUM_KNOWN_OBJ_ATTRIBUTES; i++) size += obj_attr_size (i, &attr[i]); for (list = elf_other_obj_attributes (abfd)[vendor]; @@ -188,7 +188,7 @@ vendor_set_obj_attr_contents (bfd *abfd, bfd_byte *contents, bfd_vma size, p += 4; attr = elf_known_obj_attributes (abfd)[vendor]; - for (i = 4; i < NUM_KNOWN_OBJ_ATTRIBUTES; i++) + for (i = LEAST_KNOWN_OBJ_ATTRIBUTE; i < NUM_KNOWN_OBJ_ATTRIBUTES; i++) { int tag = i; if (get_elf_backend_data (abfd)->obj_attrs_order) @@ -349,9 +349,11 @@ _bfd_elf_copy_obj_attributes (bfd *ibfd, bfd *obfd) for (vendor = OBJ_ATTR_FIRST; vendor <= OBJ_ATTR_LAST; vendor++) { - in_attr = &elf_known_obj_attributes (ibfd)[vendor][4]; - out_attr = &elf_known_obj_attributes (obfd)[vendor][4]; - for (i = 4; i < NUM_KNOWN_OBJ_ATTRIBUTES; i++) + in_attr + = &elf_known_obj_attributes (ibfd)[vendor][LEAST_KNOWN_OBJ_ATTRIBUTE]; + out_attr + = &elf_known_obj_attributes (obfd)[vendor][LEAST_KNOWN_OBJ_ATTRIBUTE]; + for (i = LEAST_KNOWN_OBJ_ATTRIBUTE; i < NUM_KNOWN_OBJ_ATTRIBUTES; i++) { out_attr->type = in_attr->type; out_attr->i = in_attr->i; |