elfedit.c: Replace BYTE_PUT with byte_put

Message ID CAMe9rOqTJdrePy7y+UA7PmFPbA743CS_Jf5=ngX=yrNwiMiW=Q@mail.gmail.com
State New
Headers show
Series
  • elfedit.c: Replace BYTE_PUT with byte_put
Related show

Commit Message

H.J. Lu Oct. 25, 2019, 10:12 p.m.
Since BYTE_PUT is defined as

 #define BYTE_PUT(field, val) byte_put (field, val, sizeof (field))

use byte_put, instead of BYTE_PUT, to put 4-byte bitmask at ptr with
"byte_put (ptr, bitmask, 4)", instead of "BYTE_PUT (ptr, bitmask)", to
work with "unsigned char *ptr".

* elfedit.c (update_gnu_property): Replace BYTE_PUT with byte_put.


-- 
H.J.

Patch

From 256878f318c60cbcc145fc95936035e0f7ff1af6 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Fri, 25 Oct 2019 15:06:39 -0700
Subject: [PATCH] elfedit.c: Replace BYTE_PUT with byte_put

Since BYTE_PUT is defined as

 #define BYTE_PUT(field, val) byte_put (field, val, sizeof (field))

use byte_put, instead of BYTE_PUT, to put 4-byte bitmask at ptr with
"byte_put (ptr, bitmask, 4)", instead of "BYTE_PUT (ptr, bitmask)", to
work with "unsigned char *ptr".

	* elfedit.c (update_gnu_property): Replace BYTE_PUT with byte_put.
---
 binutils/ChangeLog | 4 ++++
 binutils/elfedit.c | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 224ebeb04e..6c5143d30e 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,7 @@ 
+2019-10-25  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* elfedit.c (update_gnu_property): Replace BYTE_PUT with byte_put.
+
 2019-10-25  Nick Clifton  <nickc@redhat.com>
 
 	* objcopy.c (struct merged_note_section): New structure.  Used to
diff --git a/binutils/elfedit.c b/binutils/elfedit.c
index ea261de424..5c0d711e8b 100644
--- a/binutils/elfedit.c
+++ b/binutils/elfedit.c
@@ -225,7 +225,7 @@  update_gnu_property (const char *file_name, FILE *file)
 			if (disable_x86_features)
 			  bitmask &= ~disable_x86_features;
 			if (old_bitmask != bitmask)
-			  BYTE_PUT (ptr, bitmask);
+			  byte_put (ptr, bitmask, 4);
 			goto out;
 		      }
 
-- 
2.21.0