This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Should elf/tst-dlopen-aout.c fail when compiled as PIE?
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Paul Pluzhnikov <ppluzhnikov at google dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Fri, 6 Mar 2015 14:26:42 -0800
- Subject: Should elf/tst-dlopen-aout.c fail when compiled as PIE?
- Authentication-results: sourceware.org; auth=none
Hi Pail,
You are the author of elf/tst-dlopen-aout.c. Should it fail
when it is compiled as PIE? With this patch:
diff --git a/elf/Makefile b/elf/Makefile
index e852b5f..7edfcb7 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -150,6 +150,8 @@ tests += loadtest restest1 preloadtest loadfail
multiload origtest resolvfail \
# reldep9
ifeq ($(build-hardcoded-path-in-tests),yes)
tests += tst-dlopen-aout
+tests-pie += tst-dlopen-aout
+CFLAGS-tst-dlopen-aout.c += $(pie-ccflag)
endif
test-srcs = tst-pathopt
selinux-enabled := $(shell cat /selinux/enforce 2> /dev/null)
I got
[hjl@gnu-6 build-x86_64-linux]$ ./elf/tst-dlopen-aout
dlopen unexpectedly succeeded
[hjl@gnu-6 build-x86_64-linux]$
--
H.J.