1- From adf017ec04c42a615b536ee035db6d3f1eebdb31 Mon Sep 17 00:00:00 2001
1+ From a01af4cb4991f6d5f0320f03d1f1d918df07caec Mon Sep 17 00:00:00 2001
22From: Marian Buschsieweke <
[email protected] >
33Date: Sat, 11 May 2024 17:51:38 +0200
4- Subject: [PATCH 4/4 ] Wrapper targets: Add endpoints for -Wl,wrap=...
4+ Subject: [PATCH] Wrapper targets: Add endpoints for -Wl,wrap=...
55
66This adds aliases needed to wrap printf() and friends.
77---
8- printf.c | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
9- 1 file changed, 87 insertions(+)
8+ printf.c | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
9+ 1 file changed, 99 insertions(+)
1010
1111diff --git a/printf.c b/printf.c
12- index 7c1ac61..8a1311c 100644
12+ index edf41d1..e00c3e5 100644
1313--- a/printf.c
1414+++ b/printf.c
1515@@ -32,6 +32,9 @@
@@ -22,7 +22,7 @@ index 7c1ac61..8a1311c 100644
2222
2323 #include "printf.h"
2424 #include "stdio_base.h"
25- @@ -920,3 +923,87 @@ static void _putchar(char character)
25+ @@ -920,3 +923,99 @@ static void _putchar(char character)
2626 {
2727 stdio_write(&character, sizeof(character));
2828 }
@@ -54,7 +54,19 @@ index 7c1ac61..8a1311c 100644
5454+ _putchar((char)c);
5555+ return 1;
5656+ }
57+ +
5758+
59+ + int __wrap_putc(int c, FILE *stream)
60+ + {
61+ + (void)stream;
62+ + _putchar((char)c);
63+ + return 1;
64+ + }
65+ +
66+ +
67+ + __attribute__((alias("__wrap_putc")))
68+ + int __wrap_fputc(int c, FILE *stream);
69+ +
5870+
5971+ int __wrap_puts(const char *s)
6072+ {
0 commit comments