public inbox for binutils-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] HOWTO_RSIZE
@ 2022-06-08 12:03 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2022-06-08 12:03 UTC (permalink / raw)
  To: bfd-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3418a349c624257d6a47a299901b9e996469acba

commit 3418a349c624257d6a47a299901b9e996469acba
Author: Alan Modra <amodra@gmail.com>
Date:   Wed Jun 8 09:33:42 2022 +0930

    HOWTO_RSIZE
    
    Define a helper macro for HOWTO.
    
           * reloc.c (HOWTO_RSIZE): Define.
           (HOWTO): Use it.
           * bfd-in2.h: Regenerate.

Diff:
---
 bfd/bfd-in2.h | 3 ++-
 bfd/reloc.c   | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 25061e153c7..02ba9706c26 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -2135,9 +2135,10 @@ struct reloc_howto_struct
   const char *name;
 };
 
+#define HOWTO_RSIZE(sz) (sz < 0 ? -sz : sz)
 #define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name,   \
               inplace, src_mask, dst_mask, pcrel_off)                  \
-  { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf,  \
+  { (unsigned) type, HOWTO_RSIZE (size), bits, right, left, ovf,       \
     size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name }
 #define EMPTY_HOWTO(C) \
   HOWTO ((C), 0, 0, 0, false, 0, complain_overflow_dont, NULL, \
diff --git a/bfd/reloc.c b/bfd/reloc.c
index 3d1768fe013..d0b2b2013dd 100644
--- a/bfd/reloc.c
+++ b/bfd/reloc.c
@@ -375,9 +375,10 @@ DESCRIPTION
 	The HOWTO macro fills in a reloc_howto_type (a typedef for
 	const struct reloc_howto_struct).
 
+.#define HOWTO_RSIZE(sz) (sz < 0 ? -sz : sz)
 .#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name,	\
 .              inplace, src_mask, dst_mask, pcrel_off)			\
-.  { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf,	\
+.  { (unsigned) type, HOWTO_RSIZE (size), bits, right, left, ovf,	\
 .    size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name }
 
 DESCRIPTION


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-06-08 12:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-08 12:03 [binutils-gdb] HOWTO_RSIZE Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).