aboutsummaryrefslogtreecommitdiff
path: root/libio/Makefile
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2024-09-07 08:32:32 -0700
committerH.J. Lu <hjl.tools@gmail.com>2024-10-01 11:18:53 +0800
commit5c06c6e0b5078ffb0aa0c09bac79f086145e0897 (patch)
tree7728579237b5e61ca558ef7595b145b1968f4f26 /libio/Makefile
parentcc256952ecb07789c423dff9712eb7a38f80e963 (diff)
downloadglibc-5c06c6e0b5078ffb0aa0c09bac79f086145e0897.tar.xz
glibc-5c06c6e0b5078ffb0aa0c09bac79f086145e0897.zip
libio: Set _vtable_offset before calling _IO_link_in [BZ #32148]
Since _IO_vtable_offset is used to detect the old binaries, set it in _IO_old_file_init_internal before calling _IO_link_in which checks _IO_vtable_offset. Add a glibc 2.0 test with copy relocation on _IO_stderr_@GLIBC_2.0 to verify that fopen won't cause memory corruption. This fixes BZ #32148. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com> (cherry picked from commit 9dfea3de7f690bff70e3c6eb346b9ad082bb2e35)
Diffstat (limited to 'libio/Makefile')
-rw-r--r--libio/Makefile7
1 files changed, 7 insertions, 0 deletions
diff --git a/libio/Makefile b/libio/Makefile
index 6a507b67ea..5292baa4e0 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -286,11 +286,18 @@ endif
ifeq ($(build-shared),yes)
aux += oldfileops oldstdfiles
tests += \
+ tst-fopen-compat \
tst-stderr-compat \
# tests
tests-2.0 += \
+ tst-fopen-compat \
tst-stderr-compat \
# tests-2.0
+
+tst-fopen-compat-ARGS = tst-fopen-compat.c
+# Disable PIE to trigger copy relocation.
+CFLAGS-tst-fopen-compat.c += -fno-pie
+tst-fopen-compat-no-pie = yes
endif
shared-only-routines = oldiofopen oldiofdopen oldiofclose oldfileops \