Segment Permissions
A program to be loaded by the system must have at least one
loadable segment, although this restriction is not required by the file
format. When the system creates loadable segment memory images, the
system gives access permissions, as specified in the
p_flags
member. All bits that are included in
the PF_MASKPROC
mask are reserved for
processor-specific semantics.
Table 15-2 ELF Segment Flags
Name | Value | Meaning |
---|---|---|
|
|
Execute |
|
|
Write |
|
|
Read |
|
|
Unspecified |
If a permission bit is 0
, that bit's type of access is denied.
Actual memory permissions depend on the memory management unit, which can vary
between systems. Although all flag combinations are valid, the system can grant more
access than requested. In no case, however, will a segment have write permission
unless this permission is specified explicitly. The following table lists both the
exact flag interpretation and the allowable flag interpretation.
Table 15-3 ELF Segment Permissions
Flags | Value | Exact | Allowable |
---|---|---|---|
None |
|
All access denied |
All access denied |
|
|
Execute only |
Read, execute |
|
|
Write only |
Read, write, execute |
|
|
Write, execute |
Read, write, execute |
|
|
Read only |
Read, execute |
|
|
Read, execute |
Read, execute |
|
|
Read, write |
Read, write, execute |
|
|
Read, write, execute |
Read, write, execute |
For example, typical text segments have read and execute, but not write permissions. Data segments normally have read, write, and execute permissions.