From 3483fe2e0bd83ee8dba72f73c6a309cae2d75e7e Mon Sep 17 00:00:00 2001 From: Andrew Stubbs Date: Mon, 19 Jan 2009 11:55:35 +0000 Subject: 2009-01-19 Andrew Stubbs 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. --- bfd/elf32-arm.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'bfd/elf32-arm.c') diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index a047c5f..bf1f06f 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -8138,15 +8138,15 @@ static int elf32_arm_obj_attrs_arg_type (int tag) { if (tag == Tag_compatibility) - return 3; + return ATTR_TYPE_FLAG_INT_VAL | ATTR_TYPE_FLAG_STR_VAL; else if (tag == Tag_nodefaults) - return 5; - else if (tag == 4 || tag == 5) - return 2; + return ATTR_TYPE_FLAG_INT_VAL | ATTR_TYPE_FLAG_NO_DEFAULT; + else if (tag == Tag_CPU_raw_name || tag == Tag_CPU_name) + return ATTR_TYPE_FLAG_STR_VAL; else if (tag < 32) - return 1; + return ATTR_TYPE_FLAG_INT_VAL; else - return (tag & 1) != 0 ? 2 : 1; + return (tag & 1) != 0 ? ATTR_TYPE_FLAG_STR_VAL : ATTR_TYPE_FLAG_INT_VAL; } /* Read the architecture from the Tag_also_compatible_with attribute, if any. -- cgit v1.1