Permissions are in the sh_flagsp_flags member of the sectionprogram header.
typedef struct {
uint32_t sh_name;
uint32_t sh_type;p_type;
uint32_t Elf32_Off sh_flags;p_offset;
Elf32_Addr sh_addr;
Elf32_Off sh_offset;p_vaddr;
uint32_t Elf32_Addr sh_size;p_paddr;
uint32_t sh_link;p_filesz;
uint32_t sh_info;p_memsz;
uint32_t sh_addralign;p_flags;
uint32_t sh_entsize;p_align;
} Elf32_Shdr;
Elf32_Phdr;
sh_flags Sections support one-bit flags that describe miscellaneous
p_flags attributes.This member Ifholds a flag bit is set in sh_flags, the
attribute is "on" for the section. Otherwise, the
attribute is "off" or does not apply. Undefined attributes
mask of areflags setrelevant to zero.
SHF_WRITE This section contains data that should bethe
writable during process execution.
segment:
SHF_ALLOC This section occupies memory during process
PF_X An executable executionsegment. Some control sections do not
reside in the memory image of an object
PF_W A writable filesegment. This attribute is off for those
PF_R A readable sectionssegment.
SHF_EXECINSTR This section contains executable machine
A text segment commonly has the flags PF_X and instructionsPF_R.
SHF_MASKPROC All bits included in this mask are reservedA
data segment commonly has PF_X, forPF_W processor-specificand semanticsPF_R.