Nick Clifton 16b577
diff -rcp ../binutils-2.24.orig/bfd/bfd-in2.h bfd/bfd-in2.h
Nick Clifton 16b577
*** ../binutils-2.24.orig/bfd/bfd-in2.h	2014-04-22 12:03:35.226872578 +0100
Nick Clifton 16b577
--- bfd/bfd-in2.h	2014-04-22 12:07:51.556393678 +0100
Nick Clifton 16b577
*************** typedef struct bfd_section *sec_ptr;
Nick Clifton 16b577
*** 294,302 ****
Nick Clifton 16b577
  
Nick Clifton 16b577
  #define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
Nick Clifton 16b577
  
Nick Clifton 16b577
- #define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE)
Nick Clifton 16b577
- #define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)
Nick Clifton 16b577
- #define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
Nick Clifton 16b577
  /* Find the address one past the end of SEC.  */
Nick Clifton 16b577
  #define bfd_get_section_limit(bfd, sec) \
Nick Clifton 16b577
    (((bfd)->direction != write_direction && (sec)->rawsize != 0	\
Nick Clifton 16b577
--- 294,299 ----
Nick Clifton 16b577
*************** struct relax_table {
Nick Clifton 16b577
*** 1592,1597 ****
Nick Clifton 16b577
--- 1589,1620 ----
Nick Clifton 16b577
    int size;
Nick Clifton 16b577
  };
Nick Clifton 16b577
  
Nick Clifton 16b577
+ /* Note: the following are provided as inline functions rather than macros
Nick Clifton 16b577
+    because not all callers use the return value.  A macro implementation
Nick Clifton 16b577
+    would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some
Nick Clifton 16b577
+    compilers will complain about comma expressions that have no effect.  */
Nick Clifton 16b577
+ static inline bfd_boolean
Nick Clifton 16b577
+ bfd_set_section_userdata (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, void * val)
Nick Clifton 16b577
+ {
Nick Clifton 16b577
+   ptr->userdata = val;
Nick Clifton 16b577
+   return TRUE;
Nick Clifton 16b577
+ }
Nick Clifton 16b577
+ 
Nick Clifton 16b577
+ static inline bfd_boolean
Nick Clifton 16b577
+ bfd_set_section_vma (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, bfd_vma val)
Nick Clifton 16b577
+ {
Nick Clifton 16b577
+   ptr->vma = ptr->lma = val;
Nick Clifton 16b577
+   ptr->user_set_vma = TRUE;
Nick Clifton 16b577
+   return TRUE;
Nick Clifton 16b577
+ }
Nick Clifton 16b577
+ 
Nick Clifton 16b577
+ static inline bfd_boolean
Nick Clifton 16b577
+ bfd_set_section_alignment (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, unsigned int val)
Nick Clifton 16b577
+ {
Nick Clifton 16b577
+   ptr->alignment_power = val;
Nick Clifton 16b577
+   return TRUE;
Nick Clifton 16b577
+ }
Nick Clifton 16b577
+ 
Nick Clifton 16b577
  /* These sections are global, and are managed by BFD.  The application
Nick Clifton 16b577
     and target back end are not permitted to change the values in
Nick Clifton 16b577
     these sections.  */
Nick Clifton 16b577
diff -rcp ../binutils-2.24.orig/bfd/bfd-in.h bfd/bfd-in.h
Nick Clifton 16b577
*** ../binutils-2.24.orig/bfd/bfd-in.h	2014-04-22 12:03:35.272868967 +0100
Nick Clifton 16b577
--- bfd/bfd-in.h	2014-04-22 12:06:12.850914084 +0100
Nick Clifton 16b577
*************** typedef struct bfd_section *sec_ptr;
Nick Clifton 16b577
*** 287,295 ****
Nick Clifton 16b577
  
Nick Clifton 16b577
  #define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
Nick Clifton 16b577
  
Nick Clifton 16b577
- #define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE)
Nick Clifton 16b577
- #define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)
Nick Clifton 16b577
- #define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
Nick Clifton 16b577
  /* Find the address one past the end of SEC.  */
Nick Clifton 16b577
  #define bfd_get_section_limit(bfd, sec) \
Nick Clifton 16b577
    (((bfd)->direction != write_direction && (sec)->rawsize != 0	\
Nick Clifton 16b577
--- 287,292 ----
Nick Clifton 16b577
diff -rcp ../binutils-2.24.orig/bfd/section.c bfd/section.c
Nick Clifton 16b577
*** ../binutils-2.24.orig/bfd/section.c	2014-04-22 12:03:35.215873442 +0100
Nick Clifton 16b577
--- bfd/section.c	2014-04-22 12:06:55.795118059 +0100
Nick Clifton 16b577
*************** CODE_FRAGMENT
Nick Clifton 16b577
*** 542,547 ****
Nick Clifton 16b577
--- 542,573 ----
Nick Clifton 16b577
  .  int size;
Nick Clifton 16b577
  .};
Nick Clifton 16b577
  .
Nick Clifton 16b577
+ .{* Note: the following are provided as inline functions rather than macros
Nick Clifton 16b577
+ .   because not all callers use the return value.  A macro implementation
Nick Clifton 16b577
+ .   would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some
Nick Clifton 16b577
+ .   compilers will complain about comma expressions that have no effect.  *}
Nick Clifton 16b577
+ .static inline bfd_boolean
Nick Clifton 16b577
+ .bfd_set_section_userdata (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, void * val)
Nick Clifton 16b577
+ .{
Nick Clifton 16b577
+ .  ptr->userdata = val;
Nick Clifton 16b577
+ .  return TRUE;
Nick Clifton 16b577
+ .}
Nick Clifton 16b577
+ .
Nick Clifton 16b577
+ .static inline bfd_boolean
Nick Clifton 16b577
+ .bfd_set_section_vma (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, bfd_vma val)
Nick Clifton 16b577
+ .{
Nick Clifton 16b577
+ .  ptr->vma = ptr->lma = val;
Nick Clifton 16b577
+ .  ptr->user_set_vma = TRUE;
Nick Clifton 16b577
+ .  return TRUE;
Nick Clifton 16b577
+ .}
Nick Clifton 16b577
+ .
Nick Clifton 16b577
+ .static inline bfd_boolean
Nick Clifton 16b577
+ .bfd_set_section_alignment (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, unsigned int val)
Nick Clifton 16b577
+ .{
Nick Clifton 16b577
+ .  ptr->alignment_power = val;
Nick Clifton 16b577
+ .  return TRUE;
Nick Clifton 16b577
+ .}
Nick Clifton 16b577
+ .
Nick Clifton 16b577
  .{* These sections are global, and are managed by BFD.  The application
Nick Clifton 16b577
  .   and target back end are not permitted to change the values in
Nick Clifton 16b577
  .   these sections.  *}