Blame SOURCES/gdb-rhbz1320945-power9-01of38.patch

01917d
commit 27b829ee701e29804216b3803fbaeb629be27491
01917d
Author: Nick Clifton <nickc@redhat.com>
01917d
Date:   Wed Jan 29 13:46:39 2014 +0000
01917d
01917d
    Following up on Tom's suggestion I am checking in a patch to replace the various
01917d
    bfd_xxx_set macros with static inline functions, so that we can avoid compile time
01917d
    warnings about comma expressions with unused values.
01917d
    
01917d
            * bfd-in.h (bfd_set_section_vma): Delete.
01917d
            (bfd_set_section_alignment): Delete.
01917d
            (bfd_set_section_userdata): Delete.
01917d
            (bfd_set_cacheable): Delete.
01917d
            * bfd.c (bfd_set_cacheable): New static inline function.
01917d
            * section.c (bfd_set_section_userdata): Likewise.
01917d
            (bfd_set_section_vma): Likewise.
01917d
            (bfd_set_section_alignment): Likewise.
01917d
            * bfd-in2.h: Regenerate.
01917d
01917d
### a/bfd/ChangeLog
01917d
### b/bfd/ChangeLog
01917d
## -1,3 +1,15 @@
01917d
+2014-01-29  Nick Clifton  <nickc@redhat.com>
01917d
+
01917d
+	* bfd-in.h (bfd_set_section_vma): Delete.
01917d
+	(bfd_set_section_alignment): Delete.
01917d
+	(bfd_set_section_userdata): Delete.
01917d
+	(bfd_set_cacheable): Delete.
01917d
+	* bfd.c (bfd_set_cacheable): New static inline function.
01917d
+	* section.c (bfd_set_section_userdata): Likewise.
01917d
+	(bfd_set_section_vma): Likewise.
01917d
+	(bfd_set_section_alignment): Likewise.
01917d
+	* bfd-in2.h: Regenerate.
01917d
+
01917d
 2014-01-28  Nick Clifton  <nickc@redhat.com>
01917d
 
01917d
 	* dwarf2.c (find_abstract_instance_name): For DW_FORM_ref_addr
01917d
--- a/bfd/bfd-in.h
01917d
+++ b/bfd/bfd-in.h
01917d
@@ -292,9 +292,6 @@ typedef struct bfd_section *sec_ptr;
01917d
 
01917d
 #define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
01917d
 
01917d
-#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE)
01917d
-#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)
01917d
-#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
01917d
 /* Find the address one past the end of SEC.  */
01917d
 #define bfd_get_section_limit(bfd, sec) \
01917d
   (((bfd)->direction != write_direction && (sec)->rawsize != 0	\
01917d
@@ -517,8 +514,6 @@ extern void warn_deprecated (const char *, const char *, int, const char *);
01917d
 
01917d
 #define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
01917d
 
01917d
-#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
01917d
-
01917d
 extern bfd_boolean bfd_cache_close
01917d
   (bfd *abfd);
01917d
 /* NB: This declaration should match the autogenerated one in libbfd.h.  */
01917d
--- a/bfd/bfd-in2.h
01917d
+++ b/bfd/bfd-in2.h
01917d
@@ -299,9 +299,6 @@ typedef struct bfd_section *sec_ptr;
01917d
 
01917d
 #define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
01917d
 
01917d
-#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE)
01917d
-#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)
01917d
-#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
01917d
 /* Find the address one past the end of SEC.  */
01917d
 #define bfd_get_section_limit(bfd, sec) \
01917d
   (((bfd)->direction != write_direction && (sec)->rawsize != 0	\
01917d
@@ -524,8 +521,6 @@ extern void warn_deprecated (const char *, const char *, int, const char *);
01917d
 
01917d
 #define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
01917d
 
01917d
-#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
01917d
-
01917d
 extern bfd_boolean bfd_cache_close
01917d
   (bfd *abfd);
01917d
 /* NB: This declaration should match the autogenerated one in libbfd.h.  */
01917d
@@ -1029,7 +1024,7 @@ bfd *bfd_openr (const char *filename, const char *target);
01917d
 
01917d
 bfd *bfd_fdopenr (const char *filename, const char *target, int fd);
01917d
 
01917d
-bfd *bfd_openstreamr (const char *, const char *, void *);
01917d
+bfd *bfd_openstreamr (const char * filename, const char * target, void * stream);
01917d
 
01917d
 bfd *bfd_openr_iovec (const char *filename, const char *target,
01917d
     void *(*open_func) (struct bfd *nbfd,
01917d
@@ -1596,6 +1591,32 @@ struct relax_table {
01917d
   int size;
01917d
 };
01917d
 
01917d
+/* Note: the following are provided as inline functions rather than macros
01917d
+   because not all callers use the return value.  A macro implementation
01917d
+   would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some
01917d
+   compilers will complain about comma expressions that have no effect.  */
01917d
+static inline bfd_boolean
01917d
+bfd_set_section_userdata (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, void * val)
01917d
+{
01917d
+  ptr->userdata = val;
01917d
+  return TRUE;
01917d
+}
01917d
+
01917d
+static inline bfd_boolean
01917d
+bfd_set_section_vma (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, bfd_vma val)
01917d
+{
01917d
+  ptr->vma = ptr->lma = val;
01917d
+  ptr->user_set_vma = TRUE;
01917d
+  return TRUE;
01917d
+}
01917d
+
01917d
+static inline bfd_boolean
01917d
+bfd_set_section_alignment (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, unsigned int val)
01917d
+{
01917d
+  ptr->alignment_power = val;
01917d
+  return TRUE;
01917d
+}
01917d
+
01917d
 /* These sections are global, and are managed by BFD.  The application
01917d
    and target back end are not permitted to change the values in
01917d
    these sections.  */
01917d
@@ -6415,6 +6436,14 @@ struct bfd
01917d
   unsigned int selective_search : 1;
01917d
 };
01917d
 
01917d
+/* See note beside bfd_set_section_userdata.  */
01917d
+static inline bfd_boolean
01917d
+bfd_set_cacheable (bfd * abfd, bfd_boolean val)
01917d
+{
01917d
+  abfd->cacheable = val;
01917d
+  return TRUE;
01917d
+}
01917d
+
01917d
 typedef enum bfd_error
01917d
 {
01917d
   bfd_error_no_error = 0,
01917d
--- a/bfd/bfd.c
01917d
+++ b/bfd/bfd.c
01917d
@@ -311,6 +311,14 @@ CODE_FRAGMENT
01917d
 .  unsigned int selective_search : 1;
01917d
 .};
01917d
 .
01917d
+.{* See note beside bfd_set_section_userdata.  *}
01917d
+.static inline bfd_boolean
01917d
+.bfd_set_cacheable (bfd * abfd, bfd_boolean val)
01917d
+.{
01917d
+.  abfd->cacheable = val;
01917d
+.  return TRUE;
01917d
+.}
01917d
+.
01917d
 */
01917d
 
01917d
 #include "sysdep.h"
01917d
--- a/bfd/section.c
01917d
+++ b/bfd/section.c
01917d
@@ -542,6 +542,32 @@ CODE_FRAGMENT
01917d
 .  int size;
01917d
 .};
01917d
 .
01917d
+.{* Note: the following are provided as inline functions rather than macros
01917d
+.   because not all callers use the return value.  A macro implementation
01917d
+.   would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some
01917d
+.   compilers will complain about comma expressions that have no effect.  *}
01917d
+.static inline bfd_boolean
01917d
+.bfd_set_section_userdata (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, void * val)
01917d
+.{
01917d
+.  ptr->userdata = val;
01917d
+.  return TRUE;
01917d
+.}
01917d
+.
01917d
+.static inline bfd_boolean
01917d
+.bfd_set_section_vma (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, bfd_vma val)
01917d
+.{
01917d
+.  ptr->vma = ptr->lma = val;
01917d
+.  ptr->user_set_vma = TRUE;
01917d
+.  return TRUE;
01917d
+.}
01917d
+.
01917d
+.static inline bfd_boolean
01917d
+.bfd_set_section_alignment (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, unsigned int val)
01917d
+.{
01917d
+.  ptr->alignment_power = val;
01917d
+.  return TRUE;
01917d
+.}
01917d
+.
01917d
 .{* These sections are global, and are managed by BFD.  The application
01917d
 .   and target back end are not permitted to change the values in
01917d
 .   these sections.  *}