From 3020f72618e4f1d7338cd42b8bc7b2813e961b5a Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Netto Date: Tue, 27 Dec 2022 18:11:43 -0300 Subject: 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 --- elf/Makefile | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'elf/Makefile') diff --git a/elf/Makefile b/elf/Makefile index 4d0e04b..be6f2ca 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -595,23 +595,9 @@ $(objpfx)tst-relro-ldso.out: tst-relro-symbols.py $(..)/scripts/glibcelf.py \ $(objpfx)tst-relro-libc.out: tst-relro-symbols.py $(..)/scripts/glibcelf.py \ $(common-objpfx)libc.so $(PYTHON) tst-relro-symbols.py $(common-objpfx)libc.so \ - --required=_IO_cookie_jumps \ --required=_IO_file_jumps \ - --required=_IO_file_jumps_maybe_mmap \ - --required=_IO_file_jumps_mmap \ - --required=_IO_mem_jumps \ - --required=_IO_printf_buffer_as_file_jumps \ - --required=_IO_proc_jumps \ - --required=_IO_str_jumps \ --required=_IO_wfile_jumps \ - --required=_IO_wfile_jumps_maybe_mmap \ - --required=_IO_wfile_jumps_mmap \ - --required=_IO_wmem_jumps \ - --required=_IO_wprintf_buffer_as_file_jumps \ - --required=_IO_wstr_jumps \ - --optional=_IO_old_cookie_jumps \ - --optional=_IO_old_file_jumps \ - --optional=_IO_old_proc_jumps \ + --required=__io_vtables \ > $@ 2>&1; $(evaluate-test) ifeq ($(run-built-tests),yes) -- cgit v1.1