This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug dynamic-link/11767] RFE: dlopen of in-memory ET_DYN or ET_EXEC object


https://sourceware.org/bugzilla/show_bug.cgi?id=11767

--- Comment #16 from Rich Felker <bugdal at aerifal dot cx> ---
As I mentioned before, using an already-mapped-in-vm DSO with dlopen is not
viable. Usually, DSOs have at least one page (where the end of .text and the
beginning of .data share a page on disk) that must be mapped twice at different
offsets, and likewise all subsequent data pages must be mapped offset by one
page from their location in the image. Further, you need to have empty VM space
for sufficiently many .bss pages past the end of the mapping. It would be
possible to require the caller to arrange all of these things, but that's
basically offloading A LOT of the ELF loading process onto the calling program
and I don't think that makes for a reasonable public interface for glibc to
provide.

If you don't demand this crazy in-place usage of the DSO image, simply copying
it to a temp file or shared memory object and loading it from there would work
perfectly well.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]