aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf-bfd.h
diff options
context:
space:
mode:
authorAndrew Stubbs <andrew.stubbs@st.com>2009-01-19 11:55:35 +0000
committerAndrew Stubbs <andrew.stubbs@st.com>2009-01-19 11:55:35 +0000
commit3483fe2e0bd83ee8dba72f73c6a309cae2d75e7e (patch)
treec8d4210731ff5b6aaa81e8ef6507582b965c0d92 /bfd/elf-bfd.h
parent2d0bb7614be1a94ab9051c35fe95514b05fc0823 (diff)
downloadfsf-binutils-gdb-3483fe2e0bd83ee8dba72f73c6a309cae2d75e7e.zip
fsf-binutils-gdb-3483fe2e0bd83ee8dba72f73c6a309cae2d75e7e.tar.gz
fsf-binutils-gdb-3483fe2e0bd83ee8dba72f73c6a309cae2d75e7e.tar.bz2
2009-01-19 Andrew Stubbs <ams@codesourcery.com>
bfd/ * elf-attrs.c (is_default_attr): Substitute magic numbers with macros. (obj_attr_size): Likewise. (write_obj_attribute): Likewise. (_bfd_elf_copy_obj_attributes): Likewise. (_bfd_elf_parse_attributes): Likewise. * elf-bfd.h (ATTR_TYPE_FLAG_INT_VAL): New define. (ATTR_TYPE_FLAG_STR_VAL, ATTR_TYPE_FLAG_NO_DEFAULT): New defines. (ATTR_TYPE_HAS_INT_VAL, ATTR_TYPE_HAS_STR_VAL): New defines. (ATTR_TYPE_HAS_NO_DEFAULT): New define. * elf32-arm.c (elf32_arm_obj_attrs_arg_type): Replace magic numbers with macros.
Diffstat (limited to 'bfd/elf-bfd.h')
-rw-r--r--bfd/elf-bfd.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index 267b4b4..c0d8c8a 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -1371,13 +1371,20 @@ struct elf_find_verdep_info
/* The maximum number of known object attributes for any target. */
#define NUM_KNOWN_OBJ_ATTRIBUTES 71
-/* The value of an object attribute. type & 1 indicates whether there
- is an integer value; type & 2 indicates whether there is a string
- value; type & 4 indicates whether the type has a default value
- (i.e. is there a value that need not be written to file). */
+/* 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). */
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_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)
+
int type;
unsigned int i;
char *s;