/* Convert to little endian format. Returns the offset upto which the fixup was performed.  */
static size_t fix_member(void *data, size_t offset, size_t size_bytes)
/* Convert to little endian format. Returns the offset upto which the fixup was performed.  */
static size_t fix_member(void *data, size_t offset, size_t size_bytes)
{
	uint8_t *src = (uint8_t *)data + offset;
	switch (size_bytes) {
	case 1:
		write_at_le8(data, *(uint8_t *)src, offset);
		break;
	case 2:
		write_at_le16(data, *(uint16_t *)src, offset);
		break;
	case 4:
		write_at_le32(data, *(uint32_t *)src, offset);
		break;
	case 8:
		write_at_le64(data, *(uint64_t *)src, offset);
		break;
	default:
		ERROR("Write size not supported %zd\n", size_bytes);
		exit(-1);
	}
	return (offset + size_bytes);
}