Skip to main content
Post Undeleted by broadway
deleted 750 characters in body
Source Link
broadway
  • 1.6k
  • 8
  • 18

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.

Permissions are in the sh_flags member of the section header.

       typedef struct {
           uint32_t   sh_name;
           uint32_t   sh_type;
           uint32_t   sh_flags;
           Elf32_Addr sh_addr;
           Elf32_Off  sh_offset;
           uint32_t   sh_size;
           uint32_t   sh_link;
           uint32_t   sh_info;
           uint32_t   sh_addralign;
           uint32_t   sh_entsize;
       } Elf32_Shdr;



   sh_flags  Sections support one-bit flags that describe miscellaneous
             attributes.  If 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
             are set to zero.

             SHF_WRITE      This section contains data that should be
                            writable during process execution.

             SHF_ALLOC      This section occupies memory during process
                            execution.  Some control sections do not
                            reside in the memory image of an object
                            file.  This attribute is off for those
                            sections.
 
             SHF_EXECINSTR  This section contains executable machine
                            instructions.

             SHF_MASKPROC   All bits included in this mask are reserved
                            for processor-specific semantics.

Permissions are in the p_flags member of the program header.

       typedef struct {
           uint32_t   p_type;
           Elf32_Off  p_offset;
           Elf32_Addr p_vaddr;
           Elf32_Addr p_paddr;
           uint32_t   p_filesz;
           uint32_t   p_memsz;
           uint32_t   p_flags;
           uint32_t   p_align;
       } Elf32_Phdr;

       p_flags     This member holds a bit mask of flags relevant to the
                   segment:

                   PF_X   An executable segment.
                   PF_W   A writable segment.
                   PF_R   A readable segment.

                   A text segment commonly has the flags PF_X and PF_R.  A
                   data segment commonly has PF_X, PF_W and PF_R.
Post Deleted by broadway
Source Link
broadway
  • 1.6k
  • 8
  • 18

Permissions are in the sh_flags member of the section header.

       typedef struct {
           uint32_t   sh_name;
           uint32_t   sh_type;
           uint32_t   sh_flags;
           Elf32_Addr sh_addr;
           Elf32_Off  sh_offset;
           uint32_t   sh_size;
           uint32_t   sh_link;
           uint32_t   sh_info;
           uint32_t   sh_addralign;
           uint32_t   sh_entsize;
       } Elf32_Shdr;



   sh_flags  Sections support one-bit flags that describe miscellaneous
             attributes.  If 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
             are set to zero.

             SHF_WRITE      This section contains data that should be
                            writable during process execution.

             SHF_ALLOC      This section occupies memory during process
                            execution.  Some control sections do not
                            reside in the memory image of an object
                            file.  This attribute is off for those
                            sections.

             SHF_EXECINSTR  This section contains executable machine
                            instructions.

             SHF_MASKPROC   All bits included in this mask are reserved
                            for processor-specific semantics.