In src\rp2_common\pico_printf\printf.c, sprintf, vsnprintf, snprintf, and others are introduced like and WRAPPER_FUNC isThere's the linker command-line option:
Also, see src\rp2_common\pico_printf\include\pico\printf.h in the Pico SDK. There are various flags like LIB_PICO_PRINTF_PICO which are controlled by pico_set_printf_implementation(TARGET compiler) in CMake.
Code:
int WRAPPER_FUNC(sprintf)(char *buffer, const char *format, ...) {
Code:
#define WRAPPER_FUNC(x) __wrap_ ## x
Could you exploit that somehow?--wrap symbol
Use a wrapper function for symbol. Any undefined reference to symbol will be resolved to __wrap_symbol. Any undefined reference to __real_symbol will be resolved to symbol. This can be used to provide a wrapper for a system function. The wrapper function should be called __wrap_symbol. If it wishes to call the system function, it should call __real_symbol.
Also, see src\rp2_common\pico_printf\include\pico\printf.h in the Pico SDK. There are various flags like LIB_PICO_PRINTF_PICO which are controlled by pico_set_printf_implementation(TARGET compiler) in CMake.
Statistics: Posted by carlk3 — Tue Mar 05, 2024 1:18 am