about summary refs log tree commit diff
path: root/elf/tst-dl-iter-static.c
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-10-31 15:46:38 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-11-02 11:30:24 -0300
commit40c112ed0d7d0577d2f84851c1f7b8157b3bd2f5 (patch)
treeb0d9fcff62eebbf4d6cdebb020e57eddb0faf7c4 /elf/tst-dl-iter-static.c
parent3d8b5dde879c6e024548118914da5bfcbd5170a7 (diff)
downloadglibc-40c112ed0d7d0577d2f84851c1f7b8157b3bd2f5.tar.gz
glibc-40c112ed0d7d0577d2f84851c1f7b8157b3bd2f5.tar.xz
glibc-40c112ed0d7d0577d2f84851c1f7b8157b3bd2f5.zip
elf: Remove allocate use on _dl_debug_printf
The maximum number of directives is already limited by the maximum
value of iovec, and current padding usage on _dl_map_object_from_fd
specifies a value of 16 (2 times sizeof (void *)) in hexa, which is
less than the INT_STRLEN_BOUND(void *) (20 for LP64).

This works if pointers are larger than 8 bytes, for instance 16.
In this case the maximum padding would be 32 and the IFMTSIZE would
be 40.

The resulting code does use a slightly larger static stack, the
output of -fstack-usage (for x86_64):

 * master:
   dl-printf.c:35:1:_dl_debug_vdprintf     1344    dynamic

 * patch:
   dl-printf.c:36:1:_dl_debug_vdprintf     2416    static

However, there is an improvement in code generation:

 * master
   text    data     bss     dec     hex filename
   3309       0       0    3309     ced elf/dl-printf.os

 * patch
   text    data     bss     dec     hex filename
   3151       0       0    3151     c4f elf/dl-printf.os

Checked on x86_64-linux-gnu.

Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
Diffstat (limited to 'elf/tst-dl-iter-static.c')
0 files changed, 0 insertions, 0 deletions