mirror of
git://sourceware.org/git/glibc.git
synced 2025-03-06 20:58:33 +01:00
libio: Fix oversized __io_vtables
IO_VTABLES_LEN is the size of the struct array in bytes, not the number
of __IO_jump_t's in the array. Drops just under 384kb from .rodata on
LP64 machines.
Fixes: 3020f72618
("libio: Remove the usage of __libc_IO_vtables")
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Florian Weimer <fweimer@redhat.com>
Tested-by: Florian Weimer <fweimer@redhat.com>
This commit is contained in:
parent
deeaa5e90f
commit
8cb69e0543
1 changed files with 4 additions and 1 deletions
|
@ -20,6 +20,7 @@
|
||||||
#include <libioP.h>
|
#include <libioP.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <ldsodefs.h>
|
#include <ldsodefs.h>
|
||||||
|
#include <array_length.h>
|
||||||
#include <pointer_guard.h>
|
#include <pointer_guard.h>
|
||||||
#include <libio-macros.h>
|
#include <libio-macros.h>
|
||||||
|
|
||||||
|
@ -88,7 +89,7 @@
|
||||||
# pragma weak __wprintf_buffer_as_file_xsputn
|
# pragma weak __wprintf_buffer_as_file_xsputn
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const struct _IO_jump_t __io_vtables[IO_VTABLES_LEN] attribute_relro =
|
const struct _IO_jump_t __io_vtables[] attribute_relro =
|
||||||
{
|
{
|
||||||
/* _IO_str_jumps */
|
/* _IO_str_jumps */
|
||||||
[IO_STR_JUMPS] =
|
[IO_STR_JUMPS] =
|
||||||
|
@ -485,6 +486,8 @@ const struct _IO_jump_t __io_vtables[IO_VTABLES_LEN] attribute_relro =
|
||||||
},
|
},
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
_Static_assert (array_length (__io_vtables) == IO_VTABLES_NUM,
|
||||||
|
"initializer count");
|
||||||
|
|
||||||
#ifdef SHARED
|
#ifdef SHARED
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue