mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-08 17:42:12 +03:00
elf: Initialize GLRO (dl_read_only_area) after static dlopen (bug 33139)
The _dl_read_only_area function in the uninitialized ld.so after static dlopen is not able to find anything. Instead, we need to redirect to the code from the statically linked main program. Fixes commit d60fffe28a46b2a41fc308c1804ff02375d27408 ("debug: Improve '%n' fortify detection (BZ 30932)"). Reviewed-by: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
This commit is contained in:
@@ -184,12 +184,19 @@ CPPFLAGS-tst-chk-cancel.c += $(no-fortify-source) -D_FORTIFY_SOURCE=2
|
||||
CFLAGS-tst-sprintf-fortify-rdonly.c += $(no-fortify-source) -D_FORTIFY_SOURCE=2
|
||||
CFLAGS-tst-sprintf-fortify-rdonly-mod.c += $(no-fortify-source) -D_FORTIFY_SOURCE=2
|
||||
CFLAGS-tst-sprintf-fortify-rdonly-dlopen.c += $(no-fortify-source) -D_FORTIFY_SOURCE=2
|
||||
CFLAGS-tst-sprintf-fortify-rdonly-static.c += $(no-fortify-source) -D_FORTIFY_SOURCE=2
|
||||
CFLAGS-tst-fortify-syslog.c += $(no-fortify-source) -D_FORTIFY_SOURCE=2
|
||||
CFLAGS-tst-fortify-wide.c += $(no-fortify-source) -D_FORTIFY_SOURCE=2
|
||||
|
||||
$(objpfx)tst-sprintf-fortify-rdonly: $(objpfx)tst-sprintf-fortify-rdonly-mod.so
|
||||
$(objpfx)tst-sprintf-fortify-rdonly.out: \
|
||||
$(objpfx)tst-sprintf-fortify-rdonly-dlopen.so
|
||||
$(objpfx)tst-sprintf-fortify-rdonly-static: \
|
||||
$(objpfx)tst-sprintf-fortify-rdonly-dlopen.o
|
||||
$(objpfx)tst-sprintf-fortify-rdonly-static.out: \
|
||||
$(objpfx)tst-sprintf-fortify-rdonly-dlopen.so
|
||||
tst-sprintf-fortify-rdonly-static-ENV = \
|
||||
LD_LIBRARY_PATH=$(objpfx):$(common-objpfx):$(common-objpfx)/elf
|
||||
|
||||
# _FORTIFY_SOURCE tests.
|
||||
# Auto-generate tests for _FORTIFY_SOURCE for different levels, compilers and
|
||||
@@ -328,9 +335,14 @@ tests = \
|
||||
tst-longjmp_chk3 \
|
||||
tst-realpath-chk \
|
||||
tst-sprintf-fortify-rdonly \
|
||||
tst-sprintf-fortify-rdonly-static \
|
||||
tst-sprintf-fortify-unchecked \
|
||||
# tests
|
||||
|
||||
tests-static = \
|
||||
tst-sprintf-fortify-rdonly-static \
|
||||
# tests-static
|
||||
|
||||
tests-time64 += \
|
||||
$(tests-all-time64-chk) \
|
||||
# tests-time64
|
||||
|
1
debug/tst-sprintf-fortify-rdonly-static.c
Normal file
1
debug/tst-sprintf-fortify-rdonly-static.c
Normal file
@@ -0,0 +1 @@
|
||||
#include "tst-sprintf-fortify-rdonly.c"
|
Reference in New Issue
Block a user