Skip to content
Commit 6458fd4f authored by This contributor prefers not to receive mails's avatar This contributor prefers not to receive mails Committed by Stefan Roese
Browse files

tools: kwbimage: Fix calculating size of binary header



Binary header consist of:
* 1 byte for header type
* 3 bytes for header size
* 1 byte for number of arguments
* 3 reserved bytes
* N*4 bytes for arguments
* M bytes (aligned to 4 bytes) for executable data
* 1 byte for information about next header
* 3 reserved bytes

The first four bytes are specified as
  sizeof(struct opt_hdr_v1)
and the remaining bytes as
  ALIGN(s.st_size, 4) + (binarye->binary.nargs + 2) * sizeof(uint32_t)

Signed-off-by: default avatarPali Rohár <pali@kernel.org>
Reviewed-by: default avatarMarek Behún <marek.behun@nic.cz>
Reviewed-by: default avatarStefan Roese <sr@denx.de>
parent 6c7f152e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment