This is the mail archive of the
mailing list for the glibc project.
Re: Should elf/tst-dlopen-aout.c fail when compiled as PIE?
- From: Paul Pluzhnikov <ppluzhnikov at google dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Roland McGrath <roland at hack dot frob dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Fri, 6 Mar 2015 15:21:39 -0800
- Subject: Re: Should elf/tst-dlopen-aout.c fail when compiled as PIE?
- Authentication-results: sourceware.org; auth=none
- References: <CAMe9rOp60JA72qpZjiTAgo+P9v1XX-ohda4526WP1Gq_h8mQ8A at mail dot gmail dot com> <20150306230012 dot CB8302C3B39 at topped-with-meat dot com> <CAMe9rOpeQkXd7FsGjxL=RRptP70xh1TWhpnmOoJ8HECuds2NWw at mail dot gmail dot com>
On Fri, Mar 6, 2015 at 3:05 PM, H.J. Lu <firstname.lastname@example.org> wrote:
> On Fri, Mar 6, 2015 at 3:00 PM, Roland McGrath <email@example.com> wrote:
>> It's clear from the content of the test that it cannot test what it's
>> intended to test unless the file it passes to dlopen it an ET_EXEC. So if
>> you want to build the test itself as PIE, then you need to change it to
>> open some file other than itself.
> Thanks. I will handle it properly.
I think adding
CFLAGS-tst-dlopen-aout.c += -fno-pie
or some such may be the right fix.
You want to have ET_EXEC, and it's easiest to guarantee ET_EXEC if you
build it yourself, and the test itself will make a good ET_EXEC to
test with -- no reason to build an extra ET_EXEC.