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.
This commit is contained in:
Andrew Stubbs
2009-01-19 11:55:35 +00:00
parent 2d0bb7614b
commit 3483fe2e0b
4 changed files with 46 additions and 25 deletions

View File

@ -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;