gABI extension proposal: PT_SHMMAP
Cary Coutant
ccoutant@gmail.com
Sun Jan 1 00:00:00 GMT 2017
> I would like to propose an extension to the ELF gABI, which is analogous
> to PT_LOAD except that it requests that the underlying file be
> memory-mapped with MAP_SHARED, rather than MAP_PRIVATE as used for
> PT_LOAD. PT_SHARED or PT_SHLOAD would be other possible names.
>
> The main motivation for this is to allow the Linux kernel vDSO to
> finally become as close to an "ordinary" ELF DSO as is possible. The
> vDSO depends on having its kernel-provided data page(s) at a specific
> offset from the vDSO code; this is currently done by ad hoc memory
> areas, which has a number of problems, especially for mixed-mode programs.
>
> The idea is to convert the vdso to a proper file in one of the
> kernel-provided filesystems (e.g. /proc or /sys); by defining this type,
> an ELF parser would be able to create the appropriate mappings without
> any ad hoc code.
>
> This may be usable for other operating systems or perhaps even in
> userspace. However, if there is no such interest then it would be
> possible for Linux to use one of the PT_*OS constants; however, I
> generally believe it is better to try to be as inclusive as possible.
I'd prefer not to add a new PT_ value that, for the most part, means
the same thing as PT_LOAD. It would be more appropriate to use a
PT_LOAD segment with a new p_flag value, say PF_SHARED. Would that
work?
-cary
More information about the Gnu-gabi
mailing list