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

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