about summary refs log tree commit diff
path: root/elf/dl-printf.c
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright dates with scripts/update-copyrightsJoseph Myers2023-01-061-1/+1
|
* elf: Remove allocate use on _dl_debug_printfAdhemerval Zanella2022-11-021-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* elf: Fix alloca size in _dl_debug_vdprintfSzabolcs Nagy2022-10-281-2/+5
| | | | | | | | | | | | | The alloca size did not consider the optional width parameter for padding which could cause buffer underflow. The width is currently used e.g. by _dl_map_object_from_fd which passes 2 * sizeof(void *) which can be larger than the alloca buffer size on targets where sizeof(void *) >= 2 * sizeof(unsigned long). Even if large width is not used on existing targets it is better to fix the formatting code to avoid surprises. Reviewed-by: Florian Weimer <fweimer@redhat.com>
* Use '%z' instead of '%Z' on printf functionsAdhemerval Zanella Netto2022-09-221-1/+1
| | | | | | | | The Z modifier is a nonstandard synonymn for z (that predates z itself) and compiler might issue an warning for in invalid conversion specifier. Reviewed-by: Florian Weimer <fweimer@redhat.com>
* elf: Split dl-printf.c from dl-misc.cFlorian Weimer2022-01-141-0/+292
This allows to use different compiler flags for the diagnostics code. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>