Skip to contentSkip to conversation

What does MAP_EXECUTABLE do?

DISCUSSION Ray Lischner 2 participants 2 messages Aug 9, 2001 – Aug 10, 2001

lore
Share & tools
lore
#0 lore raw

Running man mmap produces the enlightening text, "Linux also knows about ... MAP_EXECUTABLE ..." but does nto tell me what MAP_EXECUTABLE actually does, and how it differs from using PROT_EXEC. Reading the source code has not helped me much.

Signature · 1 line
Ray Lischner (http://www.tempest-sw.com/)
#1 lore raw
Quoted 4 lines · [email protected] said:

Running man mmap produces the enlightening text, "Linux also knows about ... MAP_EXECUTABLE ..." but does nto tell me what MAP_EXECUTABLE actually does, and how it differs from using PROT_EXEC. Reading the source code has not helped me much.

PROT_EXEC tells the VM system the area is executable code.

MAP_EXECUTABLE says this mapping is the actual executable file itself, not a shared library, trampoline, or other executable thing.

Only used for /proc/pid/exe link and /proc/pid/status VmExe field.

You can't set it via mmap() from userspace; the kernel uses it internally when execing an elf or a.out file.

		-- Pete