SYM File

Structure

  •  Programme header
  • Section
  • Symbol table

Programme header

  • An executable or shared object file's program header table is an array of structures.
  • each describing a segment or other information the system needs to prepare the program for execution.
  • An object file segment contains one or more sections.
  • Program headers are meaningful only for executable and shared object files.
  • A file specifies its own program header size with the ELF header's e_phentsize and e_phnum members.

 

  • typedef struct {
    • Elf32_Word p_type;//tells what kind of segment this array element describes or how to interpret the array element's information.
    • Elf32_Off p_offset;//gives the offset from the beginning of the file at which the first byte of the segment resides.
    • Elf32_Addr p_vaddr;//gives the virtual address at which the first byte of the segment resides in memory.
    • Elf32_Addr p_paddr; //On systems for which physical addressing is relevant, this member is reserved for the segment's physical address.
    • Elf32_Word p_filesz; //This member gives the number of bytes in the file image of the segment; it may be zero.
    • Elf32_Word p_memsz; //This member gives the number of bytes in the memory image of the segment; it may be zero.
    • Elf32_Word p_flags; //This member gives flags relevant to the segment.
    • Elf32_Word p_align; //This member gives the value to which the segments are aligned in memory and in the file.
  • } Elf32_Phdr;

 

  • p_type
      • Name             Value             meaning
      • PT_NULL        0                          The array element is unused
      • PT_LOAD        1                           The array element specifies a loadable segment
      • PT_DYNAMIC      2                           The array element specifies dynamic linking information
      • PT_INTERP       3                           The array element specifies the location and size of a null- terminated path name to invoke as an interpreter
      • PT_NOTE       4                      The array element specifies the location and size of auxiliary information
      • PT_SHLIB         5                             This segment type is reserved, has unspecified semantics
      • PT_PHDR         6                             specifies the location and size of the program header table itself
      • PT_LOPROC         0x70000000         reserved for processor-specific semantics
      • PT_HIPROC       0x7fffffff

 

转载于:https://www.cnblogs.com/zhizhi25/p/9762791.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值