libio: Remove the usage of __libc_IO_vtables
commit3020f72618e4f1d7338cd42b8bc7b2813e961b5a
authorAdhemerval Zanella Netto <adhemerval.zanella@linaro.org>
Tue, 27 Dec 2022 21:11:43 +0000 (27 18:11 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 27 Mar 2023 16:57:55 +0000 (27 13:57 -0300)
treed61cc39cb5aa140de5331cd1a2ba6ab796db0c81
parentf65ca70deaf38db4ca12458e74cefd8ad9063956
libio: Remove the usage of __libc_IO_vtables

Instead of using a special ELF section along with a linker script
directive to put the IO vtables within the RELRO section, the libio
vtables are all moved to an array marked as data.relro (so linker
will place in the RELRO segment without the need of extra directives).

To avoid static linking namespace issues and including all vtable
referenced objects, all required function pointers are set to weak alias.

Checked on x86_64-linux-gnu, i686-linux-gnu, and aarch64-linux-gnu.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
22 files changed:
Makerules
elf/Makefile
include/libc-symbols.h
libio/Makefile
libio/fileops.c
libio/iofopncook.c
libio/iopopen.c
libio/libio-macros.sym [new file with mode: 0644]
libio/libioP.h
libio/memstream.c
libio/oldfileops.c
libio/oldiopopen.c
libio/stdio.c
libio/strfile.h
libio/strops.c
libio/tst-vtables-interposed.c
libio/vtables.c
libio/wfileops.c
libio/wmemstream.c
libio/wstrops.c
stdio-common/printf_buffer_as_file.c
stdio-common/wprintf_buffer_as_file.c