This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch 4/6] ARM attributes: defaultless attributes


Hi Andrew,

The attached patch adds a new flag for the attribute type. This flag
indicates that the attribute does not have a default value.

Would you mind doing some tidying of this code ?


I really don't like magic numbers, so it would be great if you could replace the type bit flags with self explanatory constants. Ie instead of:

  /* The value of an object attribute.  type & 1 indicates whether there
     is an integer value; type & 2 indicates whether there is a string
     value.  */

have something like:

  #define TYPE_FLAG_INT_VAL   (1 << 0)
  #define TYPE_FLAG_STR_VAL   (1 << 1)
  #define TYPE_FLAG_DEFAULT   (1 << 2)

  #define TYPE_HAS_INT_VAL(TYPE)  ((TYPE) & TYPE_FLAG_INT_VAL)
  #define TYPE_HAS_STR_VAL(TYPE)  ((TYPE) & TYPE_FLAG_STR_VAL)
  #define TYPE_HAS_DEFAULT(TYPE)  ((TYPE) & TYPE_FLAG_DEFAULT)

Plus suitable changes to elf-attrs.c as well.

Cheers
  Nick


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]