[U-Boot] [PATCH v2 04/23] SPL: tiny-printf: add "l" modifier

Simon Glass sjg at chromium.org
Mon Dec 5 07:25:23 CET 2016


On 4 December 2016 at 18:52, Andre Przywara <andre.przywara at arm.com> wrote:
> tiny-printf does not know about the "l" modifier so far, which breaks
> the crash dump on AArch64, because it uses %lx to print the registers.
> Add an easy way of handling longs correctly. Also there are printfs
> using the '-' modifier, which we choose to ignore for simplicity.
>
> Using a relatively decent compiler (GCC 5.3.0) this does _not_ increase
> the code size of tiny-printf.o for 32-bit builds (where long and int
> are actually the same), actually it looses three (ARM Thumb2) instructions
> from the actual SPL (numbers for orangepi_plus_defconfig):
>   text    data     bss     dec     hex filename
>    758       0       0     758     2f6 spl/lib/tiny-printf.o    before
>  18839     488     232   19559    4c67 spl/u-boot-spl           before
>    758       0       0     758     2f6 spl/lib/tiny-printf.o    after
>  18833     488     232   19553    4c61 spl/u-boot-spl           after
>
> This adds some substantial amount of code to a 64-bit build, though:
> (taken after a later commit, which enables the ARM64 SPL build for sunxi)
>   text    data     bss     dec     hex filename
>   1542       0       0    1542     606 spl/lib/tiny-printf.o    before
>  25830     392     360   26582    67d6 spl/u-boot-spl           before
>   1758       0       0    1758     6de spl/lib/tiny-printf.o    after
>  26040     392     360   26792    68a8 spl/u-boot-spl           after
>
> Signed-off-by: Andre Przywara <andre.przywara at arm.com>
> ---
>  lib/tiny-printf.c | 50 +++++++++++++++++++++++++++++++++++++++-----------
>  1 file changed, 39 insertions(+), 11 deletions(-)

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list