[COMMITTED, V3 4/5] libsframe: rename flip_fre_stack_offsets to flip_fre_datawords

Indu Bhagat indu.bhagat@oracle.com
Fri Jan 23 22:50:25 GMT 2026


Also adjust function level comment for flip_fre_datawords.

libsframe/
	* sframe.c (flip_fre_stack_offsets): Rename to
	flip_fre_datawords.

---
[No changes in V2]

[Changes in V3]
  - Corrected stale use of SFRAME_FRE_OFFSET_4B to SFRAME_FRE_DATAWORD_4B.
[End of changes in V3]
---
 libsframe/sframe.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/libsframe/sframe.c b/libsframe/sframe.c
index 033f1681d4d..a8e68950ad5 100644
--- a/libsframe/sframe.c
+++ b/libsframe/sframe.c
@@ -402,20 +402,21 @@ flip_fre_start_address (void *addr, uint32_t fre_type)
 }
 
 static void
-flip_fre_stack_offsets (void *offsets, uint8_t offset_size, uint8_t offset_cnt)
+flip_fre_datawords (void *datawords, uint8_t dataword_size,
+		    uint8_t dataword_cnt)
 {
   int j;
 
-  if (offset_size == SFRAME_FRE_OFFSET_2B)
+  if (dataword_size == SFRAME_FRE_DATAWORD_2B)
     {
-      struct { uint16_t x; } ATTRIBUTE_PACKED *p = offsets;
-      for (j = offset_cnt; j > 0; p++, j--)
+      struct { uint16_t x; } ATTRIBUTE_PACKED *p = datawords;
+      for (j = dataword_cnt; j > 0; p++, j--)
 	swap_thing (p->x);
     }
-  else if (offset_size == SFRAME_FRE_OFFSET_4B)
+  else if (dataword_size == SFRAME_FRE_DATAWORD_4B)
     {
-      struct { uint32_t x; } ATTRIBUTE_PACKED *p = offsets;
-      for (j = offset_cnt; j > 0; p++, j--)
+      struct { uint32_t x; } ATTRIBUTE_PACKED *p = datawords;
+      for (j = dataword_cnt; j > 0; p++, j--)
 	swap_thing (p->x);
     }
 }
@@ -692,7 +693,7 @@ flip_fre (char *fp, size_t fp_size, uint32_t fre_type, size_t *fre_size)
   offset_bytes_size = sframe_fre_offset_bytes_size (fre_info);
   if (offset_bytes_size > fp_size)
     return SFRAME_ERR;
-  flip_fre_stack_offsets (fp, offset_size, offset_cnt);
+  flip_fre_datawords (fp, offset_size, offset_cnt);
 
   *fre_size = addr_size + fre_info_size + offset_bytes_size;
 
-- 
2.43.0



More information about the Binutils mailing list