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

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