DDisasm Code Note

ELF loader

Section

some section might be useful. We can know what they are by some flag.

  • SHF_SHARE(loadable):
    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(executable)
    This section contains executable machine instructions.
  • SHF_WRITE( writable)
    This section contains data that should be writable during process execution.
  • SHT_NOBITS(initialized)
    A section of this type occupies no space in the file but otherwise resembles SHT_PROGBITS. Although this section contains no bytes, the sh_offset member contains the conceptual file offset.
  • SHF_TLS(shouldn't be loaded)
    This section holds Thread-Local Storage, meaning that each separate execution flow has its own distinct instance of this data. Implementations need not support this flag.

Symbol

ddisasm skip symbol table (maybe just not all binary can have symbol table)
symbol may have version suffix("@"), delete them

Symbols with special section index do not have an address.

  • SHN_UNDEF:
    This section table index indicates that the symbol is undefined. When the link-editor combines this object file with another object that defines the indicated symbol, this file's references to the symbol is bound to the definition.
  • The system reserves indexes between SHN_LORESERVE and SHN_HIRESERVE, inclusive. The values do not reference the section header table. The section header table does not contain entries for the reserved indexes.

Aux Data

  • binary type (dyn/exec)
  • relocation
    Relocation is the process of connecting symbolic references with symbolic definitions. For example, when a program calls a function, the associated call instruction must transfer control to the proper destination address at execution. Relocatable files must have ``relocation entries'' which are necessary because they contain information that describes how to modify their section contents, thus allowing executable and shared object files to hold the right information for a process's program image.
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容