libsframe: write out SFrame FRE start address correctly
authorIndu Bhagat <indu.bhagat@oracle.com>
Sun, 25 Dec 2022 08:06:22 +0000 (00:06 -0800)
committerIndu Bhagat <indu.bhagat@oracle.com>
Sun, 25 Dec 2022 08:08:27 +0000 (00:08 -0800)
commit68bb0d2765abfdcd9f2b29311c60b5472f0b1a24
tree7a0cac150dc25e7571970b85ffb9586e7b8c15c8
parent111b1cf97e7e5a8db35b48c4a9d93692dec799ce
libsframe: write out SFrame FRE start address correctly

The following test was failing on ppc64 and s390x:
  "FAIL: encode-1: Encode buffer match"

The offending stub was how we memcpy the FRE start address to the buffer
(on-disk format).  When the host is big-endian, the address of the
source buffer for the memcpy needs to point to the uint8_t/uint16_t sized
value of the FRE start addr, not uint32_t sized value; we intend to copy
out only the fre_start_addr_sz number of bytes.

ChangeLog:

* libsframe/sframe.c (sframe_encoder_write_fre_start_addr): New
function.
(sframe_encoder_write_fre): Use it instead of memcpy.
libsframe/sframe.c