From: Bartlomiej Sieka <tur@semihalf.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] New Image format: headers hashes.
Date: Thu, 03 Apr 2008 13:48:23 +0200 [thread overview]
Message-ID: <47F4C407.5020300@semihalf.com> (raw)
In-Reply-To: <1207216264.27240.12.camel@localhost>
Luigi 'Comio' Mantellini wrote:
> Hi Bartlomiej,
>
> thank you for the answers. See my comments below.
>
> On gio, 2008-04-03 at 11:31 +0200, Bartlomiej Sieka wrote:
>> Hi Luigi,
>>
>> You wrote:
>>> On gio, 2008-03-27 at 12:13 +0100, L
>>> - I'm interested to calculate and store from U-boot code but the
>>> fit_image_set_hashes is compiled only when the USE_HOSTCC symbol is
>>> defined. Why? Is there a particular reason?
>> There's no need for the function that you mention in current U-Boot
>> code, that's the reason why it's under USE_HOSTCC. If you're planning on
>> adding code to U-Boot that will use fit_image_set_hashes(), then just
>> remove the USE_HOSTCC #define's from around this function.
>>
>>
>> > I think that a lot of
>> > useful functions (ifdef-ed by USE_HOSTCC) should be available also in
>> > u-boot code, anyway the linker will drop the unused functions.
>>
>> I don't think the linker will do this in case of U-Boot:
>>
>> With the following patch:
>>
>> diff --git a/common/image.c b/common/image.c
>> index f04826a..850a9e4 100644
>> --- a/common/image.c
>> +++ b/common/image.c
>> @@ -1950,7 +1950,6 @@ static int calculate_hash (const void *data, int
>> data_len,
>> return 0;
>> }
>>
>> -#ifdef USE_HOSTCC
>> /**
>> * fit_set_hashes - process FIT component image nodes and calculate hashes
>> * @fit: pointer to the FIT format image header
>> @@ -2119,7 +2118,6 @@ int fit_image_hash_set_value (void *fit, int
>> noffset, uint
>>
>> return 0;
>> }
>> -#endif /* USE_HOSTCC */
>>
>> /**
>> * fit_image_check_hashes - verify data intergity
>>
>>
>> I see:
>>
>> $ ${CROSS_COMPILE}nm -S common/image.o | grep fit_image_set_hashes
>> 0000155c 000001f4 T fit_image_set_hashes
>> $ ${CROSS_COMPILE}nm -S common/libcommon.a | grep fit_image_set_hashes
>> 0000155c 000001f4 T fit_image_set_hashes
>> $ ${CROSS_COMPILE}nm -S u-boot | grep fit_image_set_hashes
>> fffb1924 000001f4 T fit_image_set_hashes
>>
>>
>> There's also size increase with the patch applied:
>> text data bss dec hex filename
>> 284615 15556 357120 657291 a078b ./u-boot
>>
>> text data bss dec hex filename
>> 285875 15572 357120 658567 a0c87 u-boot
>>
>>
>
> Before to make this test, you should strip the elf-file in order to omit
> the non-used code. Alternatively you should check the size of the
> u-boot.bin file (that is striped by definition).
"objcopy -O binary" which is used to create u-boot.bin from u-boot
doesn't remove unused functions -- code for fit_image_set_hashes (and
other functions removed from under #ifdef USE_HOSTCC by the patch) is
present in u-boot.bin.
If you add enough of such dead code, you'll see the increase in size of
u-boot.bin, or run into linking problems -- depending on the particular
linker script used for the target.
Regards,
Bartlomiej
next prev parent reply other threads:[~2008-04-03 11:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-27 11:13 [U-Boot-Users] New Image format: headers hashes Luigi 'Comio' Mantellini
2008-03-27 16:06 ` Luigi 'Comio' Mantellini
2008-03-27 22:26 ` Luigi 'Comio' Mantellini
2008-04-03 9:31 ` Bartlomiej Sieka
2008-04-03 9:51 ` Luigi 'Comio' Mantellini
2008-04-03 11:48 ` Bartlomiej Sieka [this message]
2008-04-03 12:55 ` Luigi 'Comio' Mantellini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47F4C407.5020300@semihalf.com \
--to=tur@semihalf.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox