1 From 92201f16cbcfd9eafe314ef6654be2ea7ba25675 Mon Sep 17 00:00:00 2001
2 From: Adam Jackson <ajax@redhat.com>
3 Date: Fri, 8 Sep 2023 15:55:19 -0400
4 Subject: [PATCH 13/44] libio: Fix oversized __io_vtables
6 IO_VTABLES_LEN is the size of the struct array in bytes, not the number
7 of __IO_jump_t's in the array. Drops just under 384kb from .rodata on
10 Fixes: 3020f72618e ("libio: Remove the usage of __libc_IO_vtables")
11 Signed-off-by: Adam Jackson <ajax@redhat.com>
12 Reviewed-by: Florian Weimer <fweimer@redhat.com>
13 Tested-by: Florian Weimer <fweimer@redhat.com>
14 (cherry picked from commit 8cb69e054386f980f9ff4d93b157861d72b2019e)
16 libio/vtables.c | 5 ++++-
17 1 file changed, 4 insertions(+), 1 deletion(-)
19 diff --git a/libio/vtables.c b/libio/vtables.c
20 index 1d8ad612e9..34f7e15f1c 100644
27 +#include <array_length.h>
28 #include <pointer_guard.h>
29 #include <libio-macros.h>
32 # pragma weak __wprintf_buffer_as_file_xsputn
35 -const struct _IO_jump_t __io_vtables[IO_VTABLES_LEN] attribute_relro =
36 +const struct _IO_jump_t __io_vtables[] attribute_relro =
40 @@ -485,6 +486,8 @@ const struct _IO_jump_t __io_vtables[IO_VTABLES_LEN] attribute_relro =
44 +_Static_assert (array_length (__io_vtables) == IO_VTABLES_NUM,
45 + "initializer count");