Should elf/tst-dlopen-aout.c fail when compiled as PIE?

H.J. Lu hjl.tools@gmail.com
Fri Mar 6 22:26:00 GMT 2015


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.



More information about the Libc-alpha mailing list