This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/11754] RFE: dlopen of ET_EXEC file
- From: "jreiser at BitWagon dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 25 Jun 2010 02:26:54 -0000
- Subject: [Bug libc/11754] RFE: dlopen of ET_EXEC file
- References: <20100624232048.11754.jreiser@BitWagon.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From jreiser at BitWagon dot com 2010-06-25 02:26 -------
Current behavior is actually even better: tantalizingly close! Fixing the
copy+paste error:
-----
void *h2 = dlopen(fname, RTLD_LAZY);
- if (0==handle) {
+ if (0==h2) {
fprintf(stderr, "dlopen failed:%s\n", dlerror());
-----
then running:
-----
dlopen ./hello32 failed:./hello32: cannot dynamically load executable
Success: /tmp/dlopen-exec-v66w8C
Hello world.
-----
Therefore "masquerading" the ET_EXEC as ET_DYN essentially works as long as the
address space is available and the operating system is in a good mood (honors
the hint when the first parameter of mmap is not NULL.) Many systems honor the
hint as a matter of policy [default, or at least administratively chosen], so
I'd like to take advantage of those cases.
--
http://sourceware.org/bugzilla/show_bug.cgi?id=11754
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.